Shaders: lower SV_RenderTargetArrayIndex and SV_ViewportArrayIndex exports #137
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!137
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-137"
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?
@davi713albano-coder on GitHub · 2026-11-24 21:46 UTC · original
davi713albano-coder:shader/rt-viewport-index-exports→main· +303 −30 · 4 files · 1 commits · openSummary
Lowers
SV_RenderTargetArrayIndex(kind = 4) andSV_ViewportArrayIndex(kind = 5) from GFX10/RDNA2exp pos1(pos1.z & 0xFFFFfor render-target array index,pos1.z >> 16for viewport array index), shifting clip/cull distance exports topos2..=pos3whenpos1carries the misc vector.Changes
crates/victory-shader/src/emit/lower.rs:SV_RenderTargetArrayIndex(low 16 bits) andSV_ViewportArrayIndex(high 16 bits) frompos1.zwhen the output signature declares either semantic, and shift clip/cull distance exports (kind6/7) topos2..=pos3.flags::VIEWPORT_RT_INDEXwhen a non-mesh stage exportskind4 or 5.crates/victory-shader/src/emit/shader.rs:flags::VIEWPORT_RT_INDEX = 1 << 9in DXILShaderFlagsmetadata and map it to0x2000(D3D_SHADER_FEATURE_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER) inSFI0.crates/victory-shader/src/emit/mod.rs:Constant(1) interpolation mode forkind4 and 5 alongsideSV_IsFrontFace(13).crates/victory-shader/src/emit/valu_tests.rs:vs_rt_and_viewport_index_exports_validate_and_create_psocovering RT-index-only, viewport-index-only, and combined RT+viewport+clip-distance (pos2) exports againstdxil.dllvalidation,SFI0(0x2000), and D3D12 graphics PSO creation on WARP.Verification
windows-latest): https://github.com/davi713albano-coder/victory-fork/actions/runs/45492377876cargo clippy --workspace --all-targets --locked -- -D warnings: passedcargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passedcargo test --workspace --locked(includingxtaskasset-policy check,dxil.dllvalidation, and D3D12 WARP PSO creation): 497 passed, 0 failed (emit::valu_tests::vs_rt_and_viewport_index_exports_validate_and_create_pso ... ok)(No title data used. AI-assisted.)
@HAL9000RELOADED on GitHub · 2026-11-25 19:29 UTC · original
RX 7900 XTX (RDNA3), Windows 10 + #402 for SM 6.6, main
d510ee4: the new testvs_rt_and_viewport_index_exports_validate_and_create_psopasses on the card with this PR, and fails with the test alone on the base. No other test changed. Run table: #129 (#129).View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.