shader: allow raw root SRV without UsedResource entry #576
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!576
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-572"
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?
@tarcisioads on GitHub · 2026-11-28 05:39 UTC · original
tarcisioads:vibe/raw-root-srv-none→main· +92 −2 · 2 files · 1 commits · openCloses #575
Summary
NoneforResourceTypeon raw root SRVs ((RootType::Descriptor, Some(ResourceType::Srv) | None, 11)) incrates/victory-shader/src/emit/lower.rs, matching raw root UAVs (0x100B) and root CBVs (13).raw_root_srv_without_used_resource_lowersincrates/victory-shader/src/emit/memory_tests.rs.How it was tested
cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings(passed, 0 warnings)cargo test -j6 -p victory-shader(420 unit + 5 sweep passed, 0 failed)cargo xtask policy(404 files ok)Checklist
cargo xtask policypasses)x86_64-pc-windows-gnullvm)@AnastasisKon on GitHub · 2026-11-28 17:07 UTC · original · approved these changes
Read the diff: the raw root SRV arm (resource type 11) now accepts
NoneforResourceType, matching the raw root UAV (0x100B) and root CBV (13) arms right above it — consistent widening, no behavior change for existingSome(Srv)cases. The new test lives inmemory_tests.rs, which iscfg(all(test, windows))like its neighbours, so it runs on Windows CI; verified the whole workspace compiles warning-free there:cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warningsclean on the head, andcargo test -p victory-shader --libbuilds and passes on macOS. Approving.@AnastasisKon on GitHub · 2026-11-28 18:16 UTC · original
Heads-up on the test in this pull request:
emit::memory_tests::raw_root_srv_without_used_resource_lowersfails on the Windows gate, and cannot pass as written.memory_testsis#[cfg(all(test, windows))], socargo test -p victory-shaderon a Mac never runs it. Its program is a compute shader, andLower::lowersetsroot_memoryfalse forHwStage::Csunless the program reads title memory, so aRootType::Descriptorwith noUsedResourceentry takesLower::root_view(the host's view of the copy, throughROOT_SRV_VIEW/ROOT_VIEW_OFFSETin the root's user data) androot_srvsstays empty — henceleft: [],right: [2]. The raw root SRV binding is taken only in a program that reads title memory. The| Nonechange itself is fine: without it the load lowers toVal::Missingand reads 0.The behaviour needs no host, so it can be pinned in a module that runs everywhere (
gfx_refusal_testsdoes this for other lowering claims): assert the user-data dwords for the view route ((10, ROOT_SRV_VIEW),(11, ROOT_VIEW_OFFSET)) and, with a pixel program that reads title memory, the root address ((10, 0),(11, 1)withmemorytrue). That fails with| Nonereverted (left: []), so it still pins this change. I have that version on a branch in the fork this was landed from; happy to hand it over if you would rather keep the fix here.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.