Repository navigation
Shaders: lower SV_RenderTargetArrayIndex and SV_ViewportArrayIndex exports - #137
Open
davi713albano-coder wants to merge 1 commit into
Open
davi713albano-coder wants to merge 1 commit into
davi713albano-coder wants to merge 1 commit into
Conversation
JustDownTV
pushed a commit
to JustDownTV/victory-gta6
that referenced
this pull request
Nov 24, 2026
davi713albano-coder
force-pushed
the
shader/rt-viewport-index-exports
branch
from
November 25, 2026 03:39
32a861a to
6ccc209
Compare
|
RX 7900 XTX (RDNA3), Windows 10 + #402 for SM 6.6, main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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.)