Shaders: bind a zero dword for empty root-constant slices #2473
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2473
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2473"
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?
@fuzeofficlal on GitHub · 2026-11-29 13:22 UTC · original
fuzeofficlal:fix/shader-host-empty-root-constants-av→main· +101 −12 · 1 files · 1 commits · merged 2026-11-30 14:12 UTCSummary
Host::root_signature_forincrates/victory-shader/src/emit/host.rsalways declaresNum32BitValues: s.user_data_dwords().max(1)for each shader stage, even when a shader reads zero user-data dwords.When a test passes an empty
Root::Constants(Vec::new()),Vec::new().as_ptr()is a dangling aligned pointer (0x4). Passing0x4with count0toSetComputeRoot32BitConstants/SetGraphicsRoot32BitConstantscrashes NVIDIA's D3D12 driver (nvwgf2umx.dll) withSTATUS_ACCESS_VIOLATION (0xc0000005). Skipping the call avoids the crash, but leaves the declared 1-dword root parameter unbound.Changes
crates/victory-shader/src/emit/host.rs: whenRoot::Constants(data)is empty, bind&[0u32][..]in bothHost::draw(SetGraphicsRoot32BitConstants) andHost::dispatch(SetComputeRoot32BitConstants), keeping every declared root parameter defined with a valid pointer.crates/victory-shader/src/emit/host.rs: addemit::host::tests::empty_root_constants_bind_zero_in_draw_and_dispatchverifying bothHost::dispatchandHost::drawwith emptyRoot::Constants(Vec::new())on NVIDIA hardware and WARP.Verification
cargo test --locked -p victory-shader --lib emit::host::— pass on RTX 5090 (VICTORY_ADAPTER=NVIDIA) and WARP.cargo clippy --locked -p victory-shader --all-targets— 0 new warnings in touched files.cargo run --quiet --locked -p xtask -- policy --staged— pass.@Dukestar69 on GitHub · 2026-11-29 13:23 UTC · original · approved these changes
Tested locally merged onto
main(829188e9).crates/victory-shader/src/emit/host.rs.cargo test -p victory-shader --lib emit::host::passed.cargo test -p victory-shader --lib emit::tests::passed (26 passed; 0 failed; 1 ignored).cargo test -p victory-shader --lib emit::lower::tests::passed (25 passed; 0 failed; 1 ignored).Clean fix binding a zero dword for empty root-constant slices in the shader host test runner. LGTM.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).