mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:25:53 +01:00
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#522
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/471
Author: @antikohza
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:feature/texture-mip-drop-6043📝 Commits (1)
87064bfd3d12: implement LEONIDA_TEXTURE_MIP_DROP quality switch (#6043)📊 Changes
8 files changed (+1205 additions, -16 deletions)
View changed files
📝
docs/boot.md(+3 -0)📝
docs/d3d12_vulkan.md(+4 -1)📝
runtime/CMakeLists.txt(+7 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+119 -9)📝
runtime/src/vulkan_replay.h(+98 -6)➕
runtime/test/d3d12_texture_mip_drop_test.cpp(+374 -0)➕
tests/test_command_list_mip_skip.py(+71 -0)➕
tests/test_texture_mip_drop.py(+529 -0)📄 Description
Fixes: #6043 (original tracking issue #6043 / low-VRAM memory pressure #2375)
What and why
Adds a configurable low-VRAM quality switch
LEONIDA_TEXTURE_MIP_DROP=N(0..3, default 0) to drop top mip level(s) of pure sampled textures at creation time.Width >> drop,Height >> drop,Depth >> drop) with a minimum clamp of 1.MipLevels - dropin the underlyingVkImageCreateInfoand allocation query.std::atomic<int> s_texture_mip_drop{-1}) to avoid thread-safety init guards on guest threads (RT-488).Map()/Unmap()cleanly rebinds subresources to the reduced mip structure and validates bounds against original descriptor counts.cpu_copy()ignores CPU writes to dropped mips (returnsS_OK) and zeroes destination buffers on read; validates box offsets and format blocks.MostDetailedMipdown by dropped mips and adjustsResourceMinLODClamp.vulkan_replay.h):prepare_texture_copy,prepare_resource_copy) are skipped (p.skip = true).TransitionBarrier,TextureBarrier) skip dropped mips and rebase subresource ranges.Tested
tests/test_texture_mip_drop.py: 22/22 tests passed (validates dimension scaling, SRV clamp remapping, CPU copy skipping/zeroing, and sentinel handling).tests/test_command_list_mip_skip.py: 2/2 tests passed (validates command list dropped mip copy skipping).runtime/test/d3d12_texture_mip_drop_test.cpp: passed on D3D12 device (verifies reduced VRAM allocation footprint, SRV sampling, and dropped-mip readback).GPUs tested: NVIDIA GeForce RTX 4050 Laptop GPU (Windows 11, driver 572.16), Apple M-series (macOS 15)
AI-assisted: yes
Checklist
mainand merges cleanly.docs/design.md(n/a - D3D12 runtime switch).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.