Shaders: structured access through a root SRV or UAV uses its raw view (stacked on #294) #709
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!709
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/709/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?
@itsRevela on GitHub · 2026-11-24 07:11 UTC · original
itsRevela:shaders/structured-root-views→main· +1562 −131 · 10 files · 4 commits · closed without mergingDepends on: #294 (root UAVs). This branch is on top of it; only the last two commits are new.
What
An indexed (structured)
buffer_load_*,buffer_store_*orbuffer_atomic_*through a descriptor built around a root SRV or UAV now goes through the root view's raw handle, at byteindex * stride + offset. The stride is the one the title declares for that root parameter (UsedResource::stride).A root descriptor is a bare address on the host, with no stride of its own. These accesses used to ask
handlefor a structured view (12 | u), which root descriptors don't have, so they stopped witha typed root view. That message was misleading for them, since none is a typed (format) access.A new
Lower::structuredholds the choice for all three access kinds. Structured buffers in tables and heaps are unchanged, as is their stride check.Why
With the title, in the opening cutscene, compute programs that write through root UAVs declared with strides of 1 to 64 bytes stopped at
a typed root viewonce #294 was in. Each dropped its dispatches.I measured in a local build with #302, #489, #294 and some local work on addresses passed as root constants (#614), which those programs need first:
a typed root viewfailures left;host pipeline refusedlines (129 without this change) don't involve them.Tested
Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 3070 Ti (driver 32.0.16.1088), Rust 1.98.1, on #294's head.
emit::valu_tests::structured_access_through_a_root_uav_reaches_index_times_stridedeclares a root UAV with a stride of 8. It does an indexed store (element 2, offset 4), an indexed atomic add (element 2, offset 0) and an indexed load, then checks the buffer the root UAV binds on the hardware GPU and on WARP. With #294'slower.rs, it fails at emit witha typed root view.cargo test -p victory-shader: 72 passed.cargo clippy -p victory-shader --tests: nothing in the changed files.cargo fmt -p victory-shader --check: clean.cargo xtask policy: ok.AI-assisted (Claude Code). The title runs used my own copy; no game data is in this PR.
🤖 Generated with Claude Code
@raffclar on GitHub · 2026-11-24 08:59 UTC · original
#294 has some issues but this branch on top is okay.
@MartinIndra02 on GitHub · 2026-11-24 09:19 UTC · original
Independent Windows + NVIDIA Ampere verification for
e50ed36:621.24), Ryzen 7 5800X3D, Rust 1.98.1 (x86_64-pc-windows-msvc).cargo test -p victory-shader --lib -- --test-threads=1: 72 passed, 0 failed (includingstructured_access_through_a_root_uav_reaches_index_times_strideon both hardware D3D12 and WARP).No game data used. AI-assisted; tests run on my machine.
@erLCoder on GitHub · 2026-11-24 13:08 UTC · original
Independent structured root UAV GPU readback on GTX 1660 Ti, NVIDIA 581.42, Windows 10 22H2 build 19045.6466, Ryzen 5 3600, Rust 1.98.1 MSVC and Agility SDK 1.620.2. PR
e50ed36includes #294 dependency0050ce5. Local SDK exports were added to the test executable; the fixture was restricted to hardware and asserts NVIDIA LUID 00000000:00017c52.cargo test --offline --locked -p victory-shader --features host --lib structured_access_through_a_root_uav_reaches_index_times_stride -- --nocapture --test-threads=1— 1 passed, 0 failed, 0 ignored, 71 filtered out. The synthetic dispatch wrote the expected words at index times stride and read them back successfully. The number of recovered title dispatches and effects on lighting remain untested.Codex prepared the worktree, ran the test and drafted this report.
@qntic on GitHub · 2026-11-24 13:25 UTC · original
integrated this with the newer main
ffe310e. the structured buffer access paths conflict with the stride table changes, so i merged both into a shared implementation.tested on rx 6600 xt. 359 workspace tests passed after the root uav integration, with both clippy configurations clean.
integration:
https://github.com/qntic/VIctory/tree/exp4/main-stack
@Marvisak on GitHub · 2026-11-25 00:28 UTC · original
Automated triage for the maintainers. Closing because this change is already in
main, ormainhas since replaced the code it patches.Stacked on #294; main already indexes a descriptor built around a root view by its own stride into the raw root view (emit/lower.rs, 'A descriptor built around a root view has the stride...').
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed