GPU: emit null buffer SRV/UAV when descriptor names a buffer with null resource #57
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/57"
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 Marvisak/VIctory. Originally posted by Yaekai on 2026-11-23T23:59:05Z.
Fixes a
DXGI_ERROR_DEVICE_HUNGon a world mesh draw (f0c7efd2aceb2aaa,Srv s1+16: buffer None).Cause
When the title creates a null buffer SRV or UAV (
resource == 0withViewDimension == BUFFER,desc[1] == 1),buffer_bytes(0)returnsNone, sonull_for()fell through tonull_like()/null_view()(orD3D12_UAV_DIMENSION_TEXTURE2D) and wrote a 2D texture descriptor into a slot where the shader expects a buffer.Fix
Check
desc.is_some_and(|d| d[1] == 1)innull_for()for bothView::ShaderandView::Unorderedso null buffer views get a matching null buffer descriptor.Verification
cargo test -p victory-gpu: 36/36 passed.mesh f0c7efd2aceb2aaano longer hangs the GPU and the world advances ~70+ frames further.Imported from Marvisak/VIctory. Originally posted by lordon1a on 2026-11-24T00:21:03Z.
Verified
071487fb2on Windows 11 (x86_64-pc-windows-gnullvm,rustc 1.100.0, applied cleanly tomain@35b054ec0): pass (no regression; static check of thed[1] == 1null-buffer SRV/UAV arms).cargo xtask policy: 150 files okcargo test -p victory-gpu: 39 passed, 0 failed.AI-assisted.
Imported from Marvisak/VIctory. Originally posted by MarlomMedeiros on 2026-11-24T00:25:56Z.
Tested on different hardware. The world-entry device removal still happens here, and the breadcrumbs say it is not the descriptor case this patch fixes.
Hardware / system
071487f,cargo build --release -p victoryandcargo build --profile diag -p victory --features diagnosticsWhat happens
DXGI_ERROR_DEVICE_HUNG(TDR) while rendering a world frame, right after entering gameplay. Auto-breadcrumbs: a graphics list stopped at command 3 of 70, opDISPATCHMESH; in-flight work before it is DispatchMesh draws (mesh3a93976a475b8bdb,1617bda5757a7804,7568b4b35f3f5592) and compute dispatches (ebe4e53f031f5249at up to 242x1x1,aaf7da7a94dc72a9,a133bf0a24aff410,4c0ac499ad613809).Why this hang is not the case the patch fixes
word[1] = 2(a texture dimension), e.g.Shader(0, Some([42, 2, 5768, 0, 0, 0, 0, 0, 0, 0])): they take the texture null path before and after this change, so on this title/hardware the new branch is never exercised.LOOP_LIMIT1<<20 -> 1<<12, shader cache cleared) does not change the hang either, so the draw is not being held by a data-driven iteration count.Patch review
Reading
descword[1] == 1 for BUFFER matches hownull_likeinterprets the dimension word, and the same field feeds the UAV dimension pick. The change looks correct for the case it describes; it just does not cover this machine's hang.Other host rejects in the same run (possibly NVIDIA-specific, mentioning in case they matter for #54/#55):
host view heap capped at 1000000(title asked 1245184,E_INVALIDARG)no host textureE_INVALIDARGon 2560x1440 formats 86 and 115 (flags 5 and 1)host pipeline refusedE_INVALIDARGon many compute pipelines (77x)Data: full
crashes.logentries (DRED + breadcrumbs from two diag runs) and the warning log excerpt: https://gist.github.com/MarlomMedeiros/cd0a1dc2da7f0bd43a2f86d80192e063