WARP: a constant buffer read through the title's null SRV at heap slot 0 removes the device (CBV handle over an SRV descriptor) #1594
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?
Imported from Marvisak/VIctory. Originally posted by ThomasSAMP on 2026-11-24T19:39:09Z.
Split out of #653 (comment, point 2), as suggested there.
What happens
On WARP, with #568 and #334 applied (they remove #653's first removal), world loading ends with
0x887A0005after a submission of one list of compute dispatches. GPU-based validation (VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_GBV=1) reports one message just before:Why
In the DXIL that
ffe310eemits for that program:rawBufferLoadthrough a heapByteAddressBuffer);createHandleFromHeap(i32 %idx)), annotated as a constant buffer ({13, 65536});cbufferLoadLegacy, unconditionally. A compare of the index with 0 (icmp ne) is computed, but nothing branches on it before the load.At run time the index is 0. Heap slot 0 holds the title's null SRV: the device-removed report shows
[heap 0: Shader(0, Some([42, 2, 5768, ...])) -> null], a view of no resource.#568 doesn't cover this: it fills table slots the title left empty with a typed null, but slot 0 here was written by the title, as an SRV.
Possible directions (not tried)
ByteAddressBuffer) instead of aCBufferhandle. That would match the SRV kind the title's heap mostly holds. It still mismatches if a slot holds a typed or structured view.Setup
Windows 11 Pro (build 26300), AMD Radeon RX 9070 XT (driver 32.0.32029.2010) and WARP, diagnostics build of
ffe310e+ #568 (cd6d559) + #334 (c99e429), own retail 1.0.2.1, Series X mode. Seen once with the debug layer alone (removal after 5 min 55) and once with GBV (removal after about 7 min, with the message above).AI-assisted (Claude Code, Claude Opus 5.5); no game data (a shader hash and DXIL op names only).
Imported from Marvisak/VIctory. Originally posted by BastienRodz on 2026-11-24T19:40:01Z.
From #568's side: right, this is outside it, and #568 can't be stretched to cover it. Its typed nulls rely on two things a computed heap index doesn't have:
shortcut:note);createHandleFromHeapwith a computed index reads the heap directly, so there is no table to swap.Slot 0 here is read both as an SRV and as a CBV, so no single descriptor in that slot can be valid for both readers. That leaves your translator directions: the read itself has to stop going through a CBV handle (or not happen) when the index points at a non-CBV slot.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T12:47:36Z.
Automated triage for the maintainers.
The path is still in
main(940d32f): incrates/victory-shader/src/emit/lower.rs,Lower::smem, a scalar buffer load is read as a raw buffer only for heap-direct constants, table entries listed as CBVs, SRVs and root UAVs; any other descriptor (such as a table slot with no used-resource entry, as here) falls through to a constant-buffer handle(13, 0x1_0000)read withcbufferLoadLegacy, unguarded. When that slot holds the title's null SRV, D3D12 sees a CBV handle over an SRV descriptor, which WARP turns into a device removal.Open PR #2068 addresses this (unlisted table constant loads lowered as guarded raw SRVs).
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by ColorMeBoom on 2026-11-27T06:06:50Z.
This looks fixed on
main, so the issue may be ready to close.main(63bcca4) no longer reads constant data through a computed heap index with a CBV handle. InLower::smem(crates/victory-shader/src/emit/lower.rs), constant data read through the resource heap itself (heap_constants, fromis_heap_direct) and constant data in a table go throughraw_viewandrawBufferLoad, with nocbufferLoadLegacyover the slot. That's the first direction suggested above, and it matches the SRV kind the title's heap holds there.c75fdba3(views the shaders pick from the heap).d71c3889added bounded root views and a guard against texture descriptors read as buffers. Both are onmain.I haven't rerun the original WARP world-load case, which needs the title. This is from reading
mainand the linked triage.AI use: Claude Code (Claude Opus 5.5).