Repository navigation
GPU: add VICTORY_TEXTURE_MIP_DROP and DXGI high-performance adapter selection (fixes #737, #1226) - #2146
GPU: add VICTORY_TEXTURE_MIP_DROP and DXGI high-performance adapter selection (fixes #737, #1226)#2146antikohza wants to merge 2 commits into
Conversation
|
I reproduced a I created two 8×8 textures with three guest mips, seeded mip 1 of an
The host descriptions confirm that the source stayed at 8×8 and the destination dropped to 4×4 in both Synthetic readback only. No game data used. AI-assisted with Codex. |
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (940d32f, Windows 11 x64, Rust 1.98.1 MSVC):
cargo test -p victory-gpu --lib srv_mips_adjustment— passed (srv_mips_adjustment_handles_straddled_and_dropped_views)cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok (183 files ok)
Clean VICTORY_TEXTURE_MIP_DROP SRV/resource mip-window adjustment and DXGI high-performance adapter selection. Looks good.
AI-assisted (Gemini 4 Neon).
catminou4
left a comment
There was a problem hiding this comment.
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
VICTORY_TEXTURE_MIP_DROP + DXGI high-performance adapter selection — env-tunable perf knobs; check the mip-drop math doesn't break feedback effects.
|
@DrDarkDK — great catch, thank you for the exact repro! Fixed in
|
Ports Marvisak/VIctory#2146 (GPL-3.0-or-later, antikohza; fixes fxceless#737, #1226). Textures with a full mip chain get their top `mip_drop` console mips omitted (VICTORY_TEXTURE_MIP_DROP, default 1 at <= 8.5 GiB dedicated VRAM), views are adjusted to the reduced chain, and title memory maps console subresources to host ones. Host writes are tracked per subresource so untouched mips still upload. The DXGI adapter pick prefers EnumAdapterByGpuPreference(HIGH_PERFORMANCE) and probes FL 12.0 without creating a device. Adapted to our tree: the "first readable level" upload keeps console mip numbers (first is compared as host_mip + mip_drop against the console layout); test calls to make_texture pass 1, 0. Co-Authored-By: antikohza <noreply@github.com>
Resolves #737, resolves #1226. Supersedes closed #1296 and #1617 per triage instructions on #737 (rebased cleanly onto
main940d32f).Summary
Introduces a proactive texture mip-drop subsystem and quality switch (
VICTORY_TEXTURE_MIP_DROP, clamped0..=3), plus high-performance DXGI adapter selection and LUID-matched VRAM detection that defaultsdrop = 1on GPUs with <= 8.5 GiB dedicated VRAM.Primary verified result: Eliminates
E_OUTOFMEMORY (0x8007000E)host allocation failures and commit exhaustion during world loading on 8 GB GPUs (~1.1–3.0 GB VRAM saved depending on card/stack), allowing 8 GB desktop and laptop GPUs to survive world streaming instead of crashing at 79 packs (#1226) or after 2.5–6 min (#1296).Changes Since Closed #1296
main(940d32f, 225 merged PRs):HostTexture(#127/13bbd6f):apply_mip_drop()preserves already-allocated full-resolution textures (mip_drop == 0) when sharingMemoryKey, whiletakes()prevents incompatible mip-dropped / full-res mixing.HostWrittennow lives directly onHostTexture(eliminating global map leaks on resource drop) and tracks per-subresource host writes (u128bitmask +HashSet<u32>overflow) acrosscopy_overlapping_mips,copy_texture_region,resolve,upload, andupload_changed.subresource_len()staging-bounds clamping inStaging::detilealongsideconsole_mip = host_mip + self.mip_dropdetiling.desc.mip_levels == 0full mip chains viamip_count(desc)in bothcompute_mip_drop_explicit()andapply_mip_drop().@ericomeehan's DXGI review feedback (host.rs):best_adapter()now prefersIDXGIFactory6::EnumAdapterByGpuPreference(DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE)so Windows per-app GPU preferences and eGPU/discrete selections take priority, falling back toEnumAdapters1max dedicated VRAM whenIDXGIFactory6is unavailable.supports_fl12()probes D3D12 Feature Level 12.0 with a null out-pointer (std::ptr::null_mut::<Option<ID3D12Device>>()) instead of creating full throwaway devices per adapter.How It Differs from #1272
main(940d32f) with zero merge conflicts (also synced withshared_texture,upload_changed,subresource_len, andtwin.rs).host.rs): avoidsD3D12CreateDevice(None, ...)picking 128 MiB iGPUs (0x887A0004) viaEnumAdapterByGpuPreference(HIGH_PERFORMANCE)+ LUID-matchedDEVICE_MEMORY.#737(opened 8h earlier) with live hardware validation across NVIDIA desktop/laptop, AMD RDNA4, WARP, and Linux/Proton.Hardware & CI Verification
1.98.1, commitc91cfaaon940d32f): run 45557329026 —Clippyclean,Clippy(--all-features) clean,xtask policyclean,victory-gpu149 passed / 0 failed / 2 ignored, full workspace 707 passed / 0 failed / 10 ignored.@cyudev, GPU: add VICTORY_TEXTURE_MIP_DROP and DXGI auto-default for <= 8 GB GPUs (fixes #737, #1226) #1296): World held 16+ minutes still running (~6,000 / 7,085 MBVRAM, down ~3 GB at3.2 fps) vs 2.5–6 min OOM crash before.@Logan-Gaillard, Patch (fork): add VICTORY_TEXTURE_MIP_DROP quality switch for low-VRAM budgets (75%–93% texture memory savings on 6GB/8GB GPUs) #737 / GPU: a failed host texture allocation removes the device instead of dropping detail (8 GB NVIDIA laptop, world load) #1226): Eliminated 40+E_OUTOFMEMORYfailures andcommand list did not close; reaches world streaming (726 draws/frame).@ghmfreitas, Patch (fork): add VICTORY_TEXTURE_MIP_DROP quality switch for low-VRAM budgets (75%–93% texture memory savings on 6GB/8GB GPUs) #737): Peak VRAM 7,843 MiB → 6,664 MiB (~1.18 GiB saved),NV_ERR_NO_MEMORY13 → 0.@bittertea0323, A configuration that gets the world stage running on a 12 GB Windows 10 card: nine stacked changes, what each fixed, and the two bottlenecks left #1086): Peak VRAM 11.3 GiB → 10.3 GiB, fitting the world stage under 12 GB.@DrDarkDK, Patch (fork): add VICTORY_TEXTURE_MIP_DROP quality switch for low-VRAM budgets (75%–93% texture memory savings on 6GB/8GB GPUs) #737): Bit-for-bit MSAA resolve readback verified across 262,144/262,144 pixels.@geiyiliyabumo, GPU: add VICTORY_TEXTURE_MIP_DROP and DXGI auto-default for <= 8 GB GPUs (fixes #737, #1226) #1296): Verified merge, unit tests, and build cleanly on RDNA4.@Witredd, GPU: add VICTORY_TEXTURE_MIP_DROP and DXGI auto-default for <= 8 GB GPUs (fixes #737, #1226) #1296): Progressed further withdrop=2/3before hitting title buffer exhaustion (#880/#407), scoping 6 GB limits cleanly.