GPU: include root-selected entries in rebuilt descriptor tables #420

Open
FIocker wants to merge 2 commits from upstream-pr/420 into main
FIocker commented 2026-11-24 03:10:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by FIocker on 2026-11-24T03:10:59Z.


A rebuilt descriptor table stops at the last statically reported resource. A translated shader can select a later entry using a root constant. This keeps selector metadata through translation and the shader cache, resolves supported root-constant forms while binding, and includes those entries in the copied span. Selected buffers are refreshed when the table is built and on cache hits.

With #336 merged, the bind rejects spans past the title heap or the actual dynamic capacity of the bound host heap. Selectors that can only be evaluated during shader execution remain a separate case.

The synthetic GFX10 fixture uses VIctory's compute pipeline and descriptor binding on D3D12 WARP. It reads two buffer sentinels through new and cached tables, checks that the static-only control leaves the later entry unpopulated, and checks that invalid spans fail admission before dispatch. The Windows workspace diagnostics suite passed on WARP. A separate local integration with #334 also verified a UAV write followed by a cached, root-selected SRV read of the same buffer in one command list.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6573756720 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/420). Originally posted by [FIocker](https://github.com/FIocker) on 2026-11-24T03:10:59Z. --- A rebuilt descriptor table stops at the last statically reported resource. A translated shader can select a later entry using a root constant. This keeps selector metadata through translation and the shader cache, resolves supported root-constant forms while binding, and includes those entries in the copied span. Selected buffers are refreshed when the table is built and on cache hits. With #336 merged, the bind rejects spans past the title heap or the actual dynamic capacity of the bound host heap. Selectors that can only be evaluated during shader execution remain a separate case. The synthetic GFX10 fixture uses VIctory's compute pipeline and descriptor binding on D3D12 WARP. It reads two buffer sentinels through new and cached tables, checks that the static-only control leaves the later entry unpopulated, and checks that invalid spans fail admission before dispatch. The Windows workspace diagnostics suite passed on WARP. A separate local integration with #334 also verified a UAV write followed by a cached, root-selected SRV read of the same buffer in one command list.
Raxstreams commented 2026-11-24 06:55:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Raxstreams on 2026-11-24T04:05:16Z.


Confirmed the production binding regression test passes in a local integration with draw admission from #336. The translated shader selected the later buffer in the rebuilt table and the GPU readback matched. The combined GPU suite completed with 127 passed and four ignored.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121694329 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/420#issuecomment-7121694329). Originally posted by [Raxstreams](https://github.com/Raxstreams) on 2026-11-24T04:05:16Z. --- Confirmed the production binding regression test passes in a local integration with draw admission from #336. The translated shader selected the later buffer in the rebuilt table and the GPU readback matched. The combined GPU suite completed with 127 passed and four ignored.
alexdeliu commented 2026-11-24 18:05:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by alexdeliu on 2026-11-24T17:23:48Z.


Merged onto main @ ffe310eb, this PR (b4b9498a) no longer compiles its tests: crates/victory-shader/src/emit/waterfall_tests.rs:77 builds a HostShader without the new root_indexed_views field, and crates/victory-gpu/src/descriptor.rs:757 calls resource::track with 3 arguments. Since 6638098c it takes a 4th, lanes: Option<&Structured>; main's tests pass Some(&st) with let st = structure::structure(&p).unwrap();.

Checked with CI's steps (both clippy runs with -D warnings, cargo test --workspace) on Windows 11, AMD RX 9070. Every open PR: https://gist.github.com/alexdeliu/ef9ef0ebc1776ff104b5aa8eaea18e87

<!-- greyfinch-sync:Marvisak/VIctory:comment:7139130479 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/420#issuecomment-7139130479). Originally posted by [alexdeliu](https://github.com/alexdeliu) on 2026-11-24T17:23:48Z. --- Merged onto `main` @ `ffe310eb`, this PR (`b4b9498a`) no longer compiles its tests: `crates/victory-shader/src/emit/waterfall_tests.rs:77` builds a `HostShader` without the new `root_indexed_views` field, and `crates/victory-gpu/src/descriptor.rs:757` calls `resource::track` with 3 arguments. Since 6638098c it takes a 4th, `lanes: Option<&Structured>`; main's tests pass `Some(&st)` with `let st = structure::structure(&p).unwrap();`. <sub>Checked with CI's steps (both clippy runs with `-D warnings`, `cargo test --workspace`) on Windows 11, AMD RX 9070. Every open PR: https://gist.github.com/alexdeliu/ef9ef0ebc1776ff104b5aa8eaea18e87</sub>
Marvisak commented 2026-11-25 01:07:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:16:52Z.


Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: crates/victory-gpu/src/draw.rs, crates/victory-gpu/src/shader_cache.rs, crates/victory-shader/src/emit/host.rs, crates/victory-shader/src/emit/mod.rs, crates/victory-shader/src/emit/valu_tests.rs, crates/victory-shader/src/resource.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148344155 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/420#issuecomment-7148344155). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:16:52Z. --- <!-- victory-triage v1 head=b4b9498abc00f5437b1e870476cbb6607215c3c3 verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `crates/victory-gpu/src/draw.rs`, `crates/victory-gpu/src/shader_cache.rs`, `crates/victory-shader/src/emit/host.rs`, `crates/victory-shader/src/emit/mod.rs`, `crates/victory-shader/src/emit/valu_tests.rs`, `crates/victory-shader/src/resource.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/420:upstream-pr/420'
git switch 'upstream-pr/420'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/420'
git switch 'upstream-pr/420'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/420'
git switch 'upstream-pr/420'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/420'
git switch 'main'
git merge --squash 'upstream-pr/420'
git switch 'main'
git merge --ff-only 'upstream-pr/420'
git switch 'main'
git merge 'upstream-pr/420'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!420
No description provided.