Shaders: structured access through a root SRV or UAV uses its raw view (stacked on #294) #709
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/709"
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 itsRevela on 2026-11-24T07:11:13Z.
Depends 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
Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T07:42:51Z.
Review: APPROVED
Verified on Windows 11 MSVC (Rust 1.98.1). \structured_access_through_a_root_uav_reaches_index_times_stride\ passes on both hardware and WARP.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T08:05:39Z.
Review: COMMENTED
Heads-up: no longer merges cleanly with current main (
7374bfb) — conflict invictory-shader/src/emit/valu_tests.rs. Needs a rebase.Head's shader crate is green on macOS 26 arm64 / rustc 1.98.1 (
cargo test -p victory-shader: 56 passed / 0 failed against its own base; its new coverage is Windows-gated). The structured-access-through-root-SRV/UAV change is mostly GPU-side, so the Windows shader+GPU run is the real check.Imported from Marvisak/VIctory. Originally posted by raffclar on 2026-11-24T08:59:54Z.
#294 has some issues but this branch on top is okay.
Imported from Marvisak/VIctory. Originally posted by MartinIndra02 on 2026-11-24T09:19:47Z.
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.
Imported from Marvisak/VIctory. Originally posted by erLCoder on 2026-11-24T13:08:32Z.
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.
Imported from Marvisak/VIctory. Originally posted by qntic on 2026-11-24T13:25:09Z.
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
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:28:00Z.
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