Repository navigation
rdna2spirv: dedupe packed VS input registers - #3403
bobcatchris wants to merge 1 commit into
Conversation
|
AI-assisted independent CPU review of
Windows Python 3.12.13 via uv, WSL LLVM 21 for RDNA2 assembly, and Windows SPIRV-Tools v2026.4 for assembly and validation. I checked the pipeline layout statically and ran the shaders in the CPU interpreter. No GPU, game data or #3386 composition. |
kacper-serewis
left a comment
There was a problem hiding this comment.
AI-assisted independent CPU review confirms the runtime follow-up reported by @whattheflop: two R32G32 semantics at r0.xy/r0.zw become one shader vec4 location, while runtime/shims/d3d12_vulkan_device.cpp:2643 appends two attributes with location 0. Dropping one attribute loses component words, especially across separate buffer slots. Please pair this with runtime mapping that preserves both sources, or explicitly reject the unsupported packed layout before pipeline creation and document the limitation.
At a8d84cf all three PR tests pass. Twelve independent typed/layout cases pass Vulkan 1.2 validation and carry four distinct words through the emitted fetch instructions; parent fails duplicate-ID validation. The translator correction works, but this is not yet a working end-to-end packed-input path. Runtime finding is source inspection, no GPU or game data.
|
Replying to @whattheflop. For the SHADER-644 comparison requested on the board, I ran the same 16 synthetic packed VS signatures through #3403 at
The choice between the implementations affects how a code-0 element packed with float is handled. A regression specifying the intended policy for that pair would pin the distinction. CPU translator/validator review only; the separate runtime attribute-location finding remains with D3D-388. AI-assisted. AI-assisted. |
|
One additional check for the SHADER-644 comparison and @tylerstraub's type matrix. I ran the same valid synthetic float VS through #3498 at AI-assisted. CPU/validator evidence only for this comparison. |
|
Tested
AI-assisted (Claude Code). Synthetic test shaders only, no game files. |
|
Tested a8d84cf (base f847748) on Windows 11, CPU-only (no GPU run; the change is in the translator): pass.
Read the diff too: the uint/sint/float mapping (1/2/other) matches what the three AI-assisted: this test run was done with Claude Code; the numbers above are its unedited output. |
|
Closing as superseded by
The CPU/GPU verification and independent reviews already posted here remain useful evidence for the mainline helper. I am not touching the dependent D3D-388 PR #3512 or its branch. |
SHADER-644: packed VS ISG1 elements must share one input variable
Claim: #3232 (comment) (carried into #3381 as @bobcatchris). Finding credit: @Vonsek.
rdna2spirv.translate()builtg.vertex_inputsone entry per ISG1 element. A packed VS signature with two elements in the same register (for examplexyandzw) then emitted two%vin{reg}OpVariabledeclarations and twoOpDecorate ... Locationinstructions. On the untouched basef847748c, the new regression reports:This change deduplicates by register before assembly. It keeps the first component type for the register (uint/sint/float), preserves the full
vertex_signaturemetadata, and raisesUnsupportedif two elements in one register genuinely disagree on component type instead of guessing. The GS sibling SHADER-642 is not touched; @Vonsek has that separately in #3386.Tests
tests/test_vs_packed_inputs.py: 3 passed on the fix. It checks one%vin0declaration, full two-element signature metadata, distinct uint/sint register types, and conflicting-type refusal.python -m pytest tests/test_translate.py tests/test_shader_index.py tests/test_shader_meta.py tests/test_vs_input_survey.py: 592 passed, 4 skipped.python -m pytest tests/semantic/test_value_semantics.py: 34 passed.python -m py_compile tools/rdna2spirv.py tests/test_vs_packed_inputs.py: clean.origin/maincontrol with only the new test copied in: 2 failed, 1 passed, including the duplicate-Id validator error above.CPU-only synthetic shaders and DXBC containers; no game files, shader excerpts, or GPU.
AI-assisted.