GPU: give null texture UAVs the title's view dimension #205
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!205
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/205/head"
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?
@asdaasdsaddf on GitHub · 2026-11-24 01:25 UTC · original
asdaasdsaddf:fix/null-uav-dimension→main· +90 −11 · 1 files · 1 commits · merged 2026-11-24 07:55 UTCWhat
When the host cannot make an unordered-access view (no host texture, a format the host does not allow, a placed texture not mirrored),
null_for()indescriptor/host.rswrote a 2D null UAV whatever dimension the title asked for. Shader views already get a null view of the title's dimension throughnull_like; unordered views did not.A shader that writes a 3D texture through such a slot then has a dimension mismatch, which D3D12 leaves undefined. GPU-based validation reports it on the world's wind field:
5bb23d336331db1disWindNew:CS_CopyWindFieldBeforeUpdateWithSmooth; its GFX10 code isimage_load/image_storewithdim:SQ_RSRC_IMG_3D.Change
null_uav_desc(dimension): a null texture UAV keeps the title's view dimension (1D, 1D array, 2D array withArraySize1, 3D withWSize-1). Multisampled dimensions (they need a cap) and slots that name no dimension stay 2D, as before.null_for()reads the dimension fromView::Unordered's description and fromView::Placed(true, ..)'s, and uses it for non-buffer null UAVs. Buffer null UAVs are unchanged.Testing
VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_GBV=1: before, the error above was reported each time the wind shader ran; after, it no longer appears once that shader is bound and dispatching. The other GBV report seen there (pixel shaders expecting an SRVTEXTURE2Dwhere the descriptor isTEXTURE1D) is a separate issue and is not addressed here.cargo test -p victory-gpu --lib: 46 pass, including two new tests: the dimension mapping, and a null 3D UAV made on the real device leaves it alive (skipped without a host GPU).DEVICE_HUNGabout 1-2 minutes into the world): it still happens with this change.🤖 Generated with Claude Code
When the host cannot make an unordered-access view (no host texture, a format the host does not allow, a placed texture not mirrored), null_for() wrote a 2D null UAV whatever the title asked for. A shader that writes a 3D texture through it then has a dimension mismatch: GPU-based validation reports it ("UAV Dimension Expected: TEXTURE3D, UAV Dimension In Descriptor: TEXTURE2D") for the world's wind field (WindNew:CS_CopyWindFieldBeforeUpdateWithSmooth, compute 5bb23d336331db1d, image_load/image_store dim:SQ_RSRC_IMG_3D). Shader views already get a null view of the title's dimension (null_like); unordered views did not. Null texture UAVs now keep the title's dimension: 1D, 1D and 2D arrays, 3D (WSize -1). Multisampled and unnamed dimensions stay 2D. With this, the validation error is gone on an RTX 5070. Tests: the dimension mapping, and a null 3D UAV made on the real device leaves it alive. Co-Authored-By: Claude Opus 5.5 <[email protected]>@SpaghettiMaster545 on GitHub · 2026-11-24 03:28 UTC · original
Tested in the world
d2a4bae+ this PR (clean merge), as a data point for #71.VICTORY_D3D12_DRED=1, its own empty cache, scripted keys into story mode.DEVICE_HUNG) at 63 s after start, which is within the range of plainmainon this machine (59–111 s over three runs, see #400).main: nothing lost or gained in translation, as expected for a descriptor change. World frames 713 ms, as onmain.So on this card the null-UAV view dimension is not what removes the device, or it is not the only thing. I did not run GPU-based validation, so I cannot say whether this PR removes the mismatch it targets in the world.
(Claude Code, Claude Opus 5.5: ran the title and summarised the log.)
@QemmHD on GitHub · 2026-11-24 05:11 UTC · original
Tested
cbb50b8onmaind2a4bae, native Windows 11, RTX 4070 SUPER, driver 621.24.cargo test --workspace --locked: 266 passed, 0 failed, 4 ignored; no new warnings. Both new tests pass on hardware.null_forchanged back tonull_uav_desc(None), both tests still pass:null_3d_uav_is_accepted_by_the_deviceonly creates the descriptor, so the wiring itself isn't covered.cs_6_6RWTexture3Dread through a null 2D UAV returns 0 and keeps the device, and so do 8 other null-kind or dimension mismatches (10/10, one process each; QemmHD/VIctoryrepro/392-null-view-kinds,e93b30a). So on Ada this fixes a GPU-based-validation report, not a device removal. The dimension values match d3d12.h.No game data used.
AI-assisted (Claude Code, Claude Opus 5.5).
Discord: bigpeppa.
@ghost on GitHub · 2026-11-24 05:51 UTC · original
Small asset-policy note on head
cbb50b8: the doc comment atcrates/victory-gpu/src/descriptor/host.rs:788names one of the title's compute shader entry points.docs/asset-policy.mdkeeps strings taken from the game out of the source, so could the comment describe it as "the world's wind-field compute shader" without the name? The fix itself looks good.Read-only review, nothing built. AI-assisted (Claude Code); the claim above was checked against this head and
mainatd2a4bae. Context: the triage in #366.