GPU: add VICTORY_TEXTURE_MIP_DROP and DXGI high-performance adapter selection (port of VIctory#2146) #84
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/84"
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?
Imported from Zettrox/ztrx. Originally posted by antikohza on 2026-11-25T09:22:41Z.
Clean port of Marvisak/VIctory#2146 (originating from
#737/#1296) ontoZettrox/ztrx:main(082f8b1), tested for 6–8 GB GPUs and hybrid laptops (relevant to#76,#74,#71,#62).What It Adds
VICTORY_TEXTURE_MIP_DROP=0..=3,VICTORY_TEXTURE_MIP_DROP_MIN_SIZE,texture.rs/resource.rs):flags & 0x7 == 0, non-MSAA, non-3D), saving ~1–3 GB of host VRAM and Windows commit memory on 6–8 GB GPUs.drop = 1when unset on GPUs with<= 8.5 GiBdedicated VRAM (matched via the actual device LUID); explicitVICTORY_TEXTURE_MIP_DROP=0..=3always overrides.1920×1080,1280×720, etc.) and textures belowVICTORY_TEXTURE_MIP_DROP_MIN_SIZE(default1024), while maintaining BCn 4×4 block alignment.host.rs):best_adapter()prefersIDXGIFactory6::EnumAdapterByGpuPreference(DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE)(respecting Windows per-app GPU preferences and discrete/eGPU selection, avoiding 128 MiB iGPUs on hybrid laptops), falling back toEnumAdapters1max dedicated VRAM.supports_fl12()probesD3D_FEATURE_LEVEL_12_0via null out-pointer without instantiating throwaway D3D12 devices.HostWrittenBitmask (descriptor/host.rs,list.rs,texture.rs):MostDetailedMip,MipLevels, andResourceMinLODClampacross all 7 SRV dimensions (1D..CubeArray).copy_texture_regionandresolvesubresource indices, handles mismatchedmip_dropCopyResourceacross same-family DXGI formats (e.g.UNORM->UNORM_SRGB) viacopy_overlapping_mips, and tracks per-subresource host writes (HostWrittenu128bitmask +HashSet<u32>fallback) while preservingztrx'shosted()lazy creation,host_wrote(),unlike(),twin_use(), andread_back().Verification
45584166709):Clippyclean,Clippy(--all-features) clean,xtask policyclean, all workspace unit & doc tests passed (503 passed, 0 failed, 7 ignored).#737/#1296/#2146) verified across RTX 3060 Ti 8 GB (~9,200 -> ~6,000 MB, 16+ min), RTX 5070 Laptop 8 GB + Intel iGPU, RTX 3070 Laptop Linux/Proton (7,843 -> 6,664 MiB), RTX 4070 SUPER 12 GB (11.3 -> 10.3 GiB), RTX 4070 Ti + WARP (bit-exact MSAA resolve), and RX 9060 XT 16 GB.Imported from Zettrox/ztrx. Originally posted by ThomasHFWright on 2026-11-25T10:37:57Z.
Tested this PR (
082f8b19c21a60c150b0b0eb0991be9c5dd8d338) on a separate local integration with #50 and #36. RTX 5090 / NVIDIA 620.73.04 / CachyOS Linux 7.3.6, GE-Proton11-14 with Experimental D3D12 DLLs (2576c0b4adfae4a76d4c89d8cf5ec4f5ca795cff).pipeline::host::tests::a_mesh_pipeline_loads_from_the_libraryandpipeline::library::tests::a_rejected_blob_gives_an_empty_library.VICTORY_TEXTURE_MIP_DROP=2confirmed in the log, default buffer/descriptor paths and no shader skips. Setup/loading artwork renders, but still Xid 13 / MMU fault at world entry, then exit 5 after 129.98 s; no world scene captured. The pre-PR integration also faults here, so this is not evidence of a regression from this PR.AI-assisted local testing. Title/tests offline; no game files, generated shaders, raw title logs or captures attached.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.