Repository navigation
Conversation
…d PS do A geometry shader decorated each varying with its signature register, which counts SV_Position as register 0, while the translated VS numbers its param exports and the PS its attribute reads from 0. Every VS+GS+PS programme set the SGD5 effect databases name (301 distinct) failed shader_link_check.py: missing output at gs->ps location 0 and vs->gs location 1. The GS now takes each varying's rank among the non-position registers, on both sides, and the gs_input_locations / gs_output_locations metadata follow. The GPU fixtures were written around the old numbering: gs_tri now draws with fs_passthru (location 0), and the gs_w64_* fixtures, which read vs_ids's param1, get a TEXCOORD1 input in register 2 (build.py gs_container) and read it there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…inst; gs_tri draws after vs_tri Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested 5e576db on AMD Radeon 610M (RADV, Mesa 26.2.6, subgroup 32..64), Linux: run_gpu_tests.py --filter gs_ with LEONIDA_VK_DEVICE=RADV passes gs_tri 4096/4096 pixels exact, and a nonexistent device name fails it with "no Vulkan physical device matches", so the filter applied. runtime/test/shaders/w64_graphics.py prints 27 fixture lines, all ok, including gs_w64_a_ring (tier A) and gs_w64_c_lane_id (tier C). tests/test_translate.py plus the GS-to-compute, wave64 halves, FSSM wave size and wave64 graphics scan suites give 652 passed. The PR's NVIDIA run was not repeated. AI-assisted. |
|
Thanks @gertify. Your RADV run covers what the RTX 4090 couldn't: AI-assisted (Claude Code). |
Kam471
left a comment
There was a problem hiding this comment.
Ran this at 5e576dbe8 on Windows 11, RTX 5070 Ti.
tests/test_translate.pywithLLVM_MC-> 597 passed;tests/test_spirv_gs_to_compute.py-> 16 passed.- GPU:
run_gpu_tests.py --filter gs_tri-> 1/1 passed,gs_tri->4096/4096 pixels exact; the run reportswave64 VS/PS/GS on 32-wide subgroups: tier A: 1; translator 1/1 +spirv-val. git diff --checkclean.
GS varyings are now numbered by rank past SV_Position, matching how the VS and PS number their outputs/inputs, instead of the previous flat sequence; the gs_tri/gs_w64_* fixtures and the docs row were updated together, and the geometry draw still matches every pixel. No blocking issue.
|
Tested
AI-assisted (Claude Code). |
kacper-serewis
left a comment
There was a problem hiding this comment.
At 5e576db all 195 cached geometry shaders translated and passed Vulkan 1.2 spirv-val on both revisions. Against independently decoded DXBC signature ranks, correct input location maps improved from 5/195 to 195/195 and output maps from 0/195 to 195/195. All six GS regression tests passed. The 301 program combinations were not replayed. A synthetic SV_RenderTargetArrayIndex still received an ordinary location, consistent with the documented limitation. Position was the only system value in the 195 cached signatures.
AI-assisted independent CPU review.
|
Tested
AI-assisted (Claude Code). |
|
Tested
|
kacper-serewis
left a comment
There was a problem hiding this comment.
AI-assisted independent review. At 5e576db the real CPU linker accepted both VS→GS and GS→PS links for a hand-written gs_tri control. The base reported a missing output at both links. Stored pipeline coverage was 0/301 because the cached shader inventory contained no pass-to-stage triples. The earlier 195/195 result verified individual geometry modules.
kacper-serewis
left a comment
There was a problem hiding this comment.
AI-assisted independent review. At 5e576db the batch linker accepted all 301 distinct stored VS→GS→PS triples (364 pass occurrences), up from 0/301 on 3faac55. All 691 referenced modules validated on both revisions. Only the 195 GS binaries changed. This package-backed CPU run closes the earlier gap in stored-triple coverage.
Claimed in the coordination issue as: new SHADER item, building the graphics pipelines the effect database defines (claim). This PR is the translator fix that item turned up.
Depends on: #4670, #2086, #4913, #5123: no code dependency, only small textual conflicts: #4670 (the
test_spirv_gs_to_compute.pylayout line), #2086 (rdna2spirv.py, next to the GS block), #4913 (the design.md Geometry shaders row) and #5123 (next togs_containerinbuild.py). Whichever lands second needs a one-line merge.What and why
A translated geometry shader decorated each varying with its signature register as its
Location. That register counts SV_Position as register 0. The translated VS numbers its outputs byparamexport index, and the PS its inputs by attribute index, both from 0. So every VS → GS → PS chain was one location off on both sides: the GS read the VS's second varying, and the PS read nothing from the GS.I found it by pairing programs the way the game does. Every stored SGD5 pass (
tools/sgd5_effects.py,docs/sgd5_render_states.md) names its VS/MS (+GS) + PS. I rantools/shader_link_check.py batchover the 16,325 distinct programme sets with a PS: 301 were incompatible, exactly all the VS+GS+PS sets, with missing-output at gs→ps location 0 and vs→gs location 1.The fix: a GS input or output varying gets its rank among the signature's non-position registers.
gs_input_locations/gs_output_locationsin the metadata (read byspirv_stubs.pyandspirv_gs_to_compute.py) follow. All 195 GS in the corpus have SV_Position in register 0 and their varyings from register 1, so for them this is register − 1.The GPU fixtures were written around the old numbering:
gs_tridrew with a PS reading location 1. It now usesfs_passthru(location 0). The expected image is unchanged: the GS copies only.xy.gs_w64_*fixtures read the vertex numbervs_idssends inparam1.build.py'sgs_containeradds a TEXCOORD1 input in register 2, which becomes Location 1, and the fixtures read it there (offset 32).tests/conftest.pymirrors it.A new test,
test_gs_locations_are_ranks_past_the_position, checks registers 1-2 in and 1, 3 out → locations 0-1 on both sides. The packed-register test now expects location 0.Tested
Windows 11, RTX 4090, NVIDIA 617.42; own 1.0.2.1 copy; LLVM 23.1.5 (
llvm-mc). Base:main3faac55; head 5e576db (the corpus run is at d3d0a1e; 5e576db changes only docs and a comment).26503 translated, 26503 pass spirv-valon both. 0 lost, 0 new, wave64 23,841 both, no flips. Exactly 195.spvchange, all of them GS.shader_link_check.py batchover the 16,325 distinct SGD5 programme sets: base 16,024 compatible, 301 incompatible; this branch 16,325 compatible, 0 incompatible, 0 invalid.python -m pytest tests/test_translate.py tests/test_spirv_gs_to_compute.py tests/test_spirv_gs_to_compute_bounds.py tests/test_wave64_halves_fixtures.py tests/test_fssm_wave_size.py tests/test_wave64_graphics_scan.py: 652 passed.python -I -m unittest discover -s tests/semantic: 6,245 tests. The 5 failures/errors are all intest_loop_ballot_barrier.py(wave64 emulation) and fail the same way on unchangedmain3faac55.run_gpu_tests.py --filter gs_→gs_tri4096/4096 pixels exact;w64_graphics.py→gs_w64_a_ringok,gs_w64_c_lane_idskipped (tier C needs a device that can require both 32 and 64; NVIDIA can't).gs_tri4096/4096 exact, with a negative control showing the device filter applied;w64_graphics.py27/27 ok, includinggs_w64_c_lane_id(tier C); the same 652 pytest tests pass.AI-assisted: yes (Claude Code).
Checklist
docs/design.md, with how it was confirmed: the Geometry shaders row, confirmed by the corpus link check above and the GPU tests.🤖 Generated with Claude Code