GPU: placed texture UAVs (View::Placed(true, ...)) are unconditionally dropped to null views #921
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#921
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?
@hyperland956-lgtm on GitHub · 2026-11-24 14:11 UTC · original
Summary
Unordered access views created on textures the title placed in its own memory (
View::Placed(true, resource, desc)) are unconditionally dropped to null UAVs incrates/victory-gpu/src/descriptor/host.rs, even though the host-texture lookup path (crate::resource::texture_at) already exists for placed texture SRVs. Any compute or pixel shader writing to a placed texture UAV has its writes silently discarded.Root cause
In
crates/victory-gpu/src/descriptor/host.rs:make()(lines 714–724) delegatesView::Placedtoplaced_texture(view)first, and if that returnsNoneandresource[0] != BUFFER, logs"placed unordered texture view not mirrored"once and returnsNone(whichnull_for()turns into a null UAV):placed_texture()(lines 738–749) hardcodesfalseforunordered, rejecting every placed texture UAV:Suggested fix
placed_texture(view)to matchView::Placed(unordered, resource, desc)for non-buffer resources:View::Unordered(texture as usize, 0, desc[..10].try_into().ok())when*unorderedistrue, andView::Shader(texture as usize, desc[..10].try_into().ok())whenfalse.crate::resource::texture_at(address, desc)(crates/victory-gpu/src/resource.rs:1153), ensure that if a placed texture is viewed as a UAV (or if a subsequent UAV view arrives for an already-cached(address, *desc)entry whoseResourceDesc.flagslackedD3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, or hadALLOW_DEPTH_STENCIL | ALLOW_UNORDERED_ACCESS), the host texture supports UAV creation (or routes through the depth+UAV twin path in #469) and is markedtexture::host_writtenso CPU-side uploads do not overwrite GPU UAV writes.Synthetic reproduction (no game data)
R32_UINTtextureResourceDescwithD3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS(flags = 0x4).View::Placed(true, resource_words, uav_desc_words)descriptor in a descriptor heap and bind it to a compute shader that writes a non-zero sentinel to(0, 0).make()hits"placed unordered texture view not mirrored", emits a null UAV, and the texture remains zero.placed_texture()resolves the placed host texture and creates a real UAV so the compute write lands in the host texture.@pickles976 on GitHub · 2026-11-24 14:14 UTC · original
Sibling cross-check (ivall/xcl), read at the source: our path never routes a placed texture to a null view —
dev_create_uav_xforwards the real desc to the host for every resource that legitimately has UAVs, including console/placed textures (those get both: the PC view and the console descriptor word; the title's at-address variant arrives on its own device-table entry, slot0x47/71dev_create_uav_at_x). Our only null-view downgrade is exactly the case your failure code describes — a resource withoutALLOW_UNORDERED_ACCESS, where forwarding the real desc would remove the host device with the same0x887A0001— guarded, warned once per four hits, and commented with the removal code. So on our side the policy line runs under the resource flag, not under placed-ness; if the title UAVs a placed texture (and given placed creations are the title's bread and butter — device slot0x428— assume it does), the null-drop makes those writes silently vanish somewhere in your frame, which reads downstream as missing visualizations rather than as this issue. Same-hash title, same conclusion either way: flag is the invariant, placement is not.@andrewpozdnakov7-jpg on GitHub · 2026-11-24 14:18 UTC · original
I reproduced the placed
R32_UINTUAV case on Windows 10 with D3D12 WARP. Onffe310e,makereturned no host texture for a placed resource carryingALLOW_UNORDERED_ACCESS.The already-written conversion in closed PR #552 does fix this case. With the same fixture on
c261d8d, the view mirrored a real texture. A native UAV clear followed by readback returned the sentinel in all 16 texels, andGetDeviceRemovedReasonsucceeded. Tested commitPR #205 addressed the typed null fallback. The conversion from the placed view to a resource-backed view is in the unmerged #552 diff. Conversion in #552
Synthetic 4×4 texture with the UAV flag. AI-assisted.
@andrewpozdnakov7-jpg on GitHub · 2026-11-24 14:36 UTC · original
Standalone fix and WARP regression directly on upstream
ffe310eb2098e52169f4c44db5ffdabf43a72622. It ports the placed-view conversion from #552 with the original author credited. Fix and test commitThe same regression uses guest placed UAV creation, VIctory’s dispatch and submission paths, and D3D12 texture readback. The synthetic shader writes one texel and leaves the neighboring texel untouched.
ffe310e: the dispatch recorded, but readback returned[0, 0, 0, 0]at the target texel.8727921: readback returned[1, 0.5, -0.25, 2]at the target and zeros at the neighboring texel.Native Windows WARP with Agility 1.620.2. GPU diagnostics: 54 passed, 1 existing benchmark ignored. Strict Clippy and asset policy passed. AI-assisted.
@MichaelSmithAI on GitHub · 2026-11-24 14:31 UTC · original · edited 2026-11-24 14:38 UTC
Two additional stable-address checks passed on an RTX 4090 under Wine/vkd3d-proton 3.2. On our local integration (afa8994), a shader read back [64, 0, 255, 255] at all four texels after a 2×2 clear in both cases:
On the comparison base (e235c44), the first UAV did not materialize and the second SRV resolved to a separate host texture. Both controls stopped at descriptor setup before submission. The first case complements the native WARP result for #552. The second also relies on the integration’s lookup of the existing texture object.
Those initial fixtures used guest descriptor creation with explicit host binding and dispatch. A follow-up on the same head now exercises both cases through the guest command-list vtable. It sets the descriptor heap and compute root tables, dispatches a DXC-built writer through the UAV, then dispatches a reader through the matching SRV into a separate output texture. The binder handles the transition between dispatches. Both tests checked the mirrored slots and read back [64, 0, 255, 255] at all four output texels. The test uses the host queue helper for submission and explicitly transitions the output for readback.
These checks cover matching descriptions and stable object lifetimes. Address reuse and the identity of the title’s 4K writer remain open. The separate native WARP regression covers guest submission for the standalone placed-UAV fix.
@NuraadGit on GitHub · 2026-11-24 16:24 UTC · original
An in-title count for this, as a near-negative result:
placed unordered texture view not mirroredwas logged in only 1 of my 107 runs on an RTX 2080. That run was on an earlyd2a4bae-based build, about a minute after launch, and the view wasdimension=3(2D). The warning was never logged on the stacks I run now (JMAN730's fork + open PRs), including 12-minute world runs, and never on the longest run (21 minutes).In one traced world frame (6,218 ops that ran, with their bound views), 13 placed UAV views are bound, and all 13 are dimension 1 (buffers).
Limits: the trace lists bindings only for ops that ran, not for the 1,507 dropped ones, and many compute programs are still refused on this card, so a program that needs this may simply not run yet. On "the identity of the title's 4K writer": here the draw that writes the presented 3840x2160 image is pixel
4f4ec7b16673362f, through an ordinary render target (see #841).AI-assisted (Claude Code): the trace and log analysis were automated. The hardware, title copy and runs are the user's.
@andrewpozdnakov7-jpg on GitHub · 2026-11-24 21:57 UTC · original
I retested the placed-UAV dispatch after the upstream texture-sharing changes, on
70564ae08c82d43df5fad97b08d34628b07b1d9d. The same WARP dispatch still read back four zeroes at the target texel. With the placed-view conversion reapplied, the texel was[1.0, 0.5, -0.25, 2.0]and its neighbor stayed zero.Rebased fix and regression, one commit on
70564aewith the original #552 credit preserved. The full GPU diagnostics suite passed 82 tests with one ignored. Strict GPU Clippy and asset policy passed.@andrewpozdnakov7-jpg on GitHub · 2026-11-25 01:09 UTC · original · edited 2026-11-25 20:18 UTC
The synthetic placed-UAV dispatch still hits this on the updated main
42363ab6cd. WARP read back [0, 0, 0, 0] before the fix. With the same test on 3a6b7e0, the target texel was [1, 0.5, -0.25, 2] and the adjacent texel stayed zero.This is one commit directly on
42363ab, carrying the #552 author credit. Full WARP GPU suite: 145 passed, 2 ignored. Strict GPU Clippy and asset policy passed.Update for current main
13f91caand #1273 atb5ea728. The exact rebased test de8b16b still holds its Git authorship. In six paired WARP runs, current main read [0, 0, 0, 0] from the target. The PR read [1, 0.5, -0.25, 2], and the adjacent texel stayed zero. The serial GPU suite passed 202 tests with one ignored in both debug settings. PR CIIf the test is folded into another commit, please add the following trailer to retain its attribution.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
@Marvisak on GitHub · 2026-11-25 06:51 UTC · original
Automated triage for the maintainers.
Confirmed on current
main: incrates/victory-gpu/src/descriptor/host.rs,placed_textureonly matchesView::Placed(false, ..), so a placed texture's unordered view never reachescrate::resource::texture_at, andmake()logs "placed unordered texture view not mirrored" and returnsNone(a null UAV). Open PR #1273 ("GPU: mirror placed unordered texture views") addresses this; the closed #552 had the conversion tested in this thread.Generated by Claude Code