Repository navigation
fix(shader): pass clip distances through the rect-list stages as the vertex shader writes them - #7334
Conversation
…vertex shader writes them The recompiled vertex shader writes gl_ClipDistance through a variable of its own beside its position block, but the rect-list control and evaluation stages read and wrote it as a second member of their per-vertex block, so the stage interfaces did not match (VUID-RuntimeSpirv-OpVariable-08746). They now take and forward the clip distances through ClipDistance variables of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Sonic Unleashed Recompiled PPSA99902, #4443/#7260, also reaches this interface mismatch. Its completed ordinary RTX5080 replay at integration38faf/mainf663, without this PR, emits9 VUID08746 errors. The first two directly follow rect-list preparation of vertex0x201320e00 with fragments0x201321000/0x201321200 and show Position-only VS output versus Position+ClipDistance TCS input. Corrected #7330 is already present. I have not attributed every one of the nine messages to a specific draw. Your exact6c47 change is now included in our composed integration027bc (main0bb plus retained bring-up fixes). Full Windows/Linux relinker/library builds pass. GPUs: RTX5080 (10de:2c02),610.62/32.0.16.1062; AMD Radeon(TM) Graphics (1002:13c0),32.0.21036.18; Windows11 Enterprise26200/GCC15.2r7. Linux: llvmpipe LLVM20.1.2/Mesa25.2.8, Ubuntu24.04 WSL2/GCC13.3, no validation layer. This is composition validation, not a run of an unchanged standalone PR head. The follow-up ordinary RTX5080 replay at 10a1b28e4a completed its1800s bound with107 spaced captures and zero logged VUID/validation errors, including zero08746. Earlier frame007 confirms the CONTINUE menu; final frame106 remains the opening cinematic, with no interactive-gameplay claim. This composition also adds queued-native-clear consumer settlement and reviewed#7310, so it is not an isolated rect-list A/B. Maintenance9 advisories and11 guest-runtime vkWaitForFences failures remain. Current title report keeps the combined outcome and limits. #7334 is now included in current main; this evidence stays pinned to the tested composition. ctest --test-dir build -V -j1 --repeat until-fail:3 --timeout 30 -R '^agc_driver_(graphics|rect_list_indirect)$'AI-assisted validation/report: Codex; author responsible. |
What
A recompiled vertex shader writes
gl_ClipDistancethrough an output variable of its own (OpDecorate %var BuiltIn ClipDistance) next to its position block.VertexClipDistanceCountreads it that way.The rect-list control and evaluation stages, which forward clip distances since #7124, declared it as a second member of their per-vertex block instead. So the vertex shader's output block (
Position) and the rect-list control stage's input block (Position,ClipDistance) did not match, and the Khronos layer reportsVUID-RuntimeSpirv-OpVariable-08746for each rect-list pipeline whose vertex shader has clip distances. It is the mismatch #7328 reports for the barycentric tessellation stages (#7330 changes those); this PR changes only the rect-list ones.RectListShaders.cppnow keepsPositionalone in the block and passes the clip distances throughBuiltIn ClipDistancevariables of their own:float[N]and an output array of 4;float[N]output.The values are the same as before: the control stage still interpolates the fourth corner's distances, and the evaluation stage still copies the selected corner's.
ShaderValidationalready strips the per-vertex dimension of such variables and checks its length (3 in, 4 out), so it accepts them as it accepted the block members.Tested
Linux (Ubuntu 24.04, GCC 13.3, Release), RTX 4070 Ti, NVIDIA 595.99.02;
mainf1af6c5.agc_driver_graphics, new rect-list case: a vertex shader with two clip distances. The control, last-vertex control and evaluation stages must each declare twoClipDistancevariables (input and output) and noClipDistanceblock member. The four stages must then validate as a rect-list pipeline.With
main'sRectListShaders.cppit fails 3 of 3 witha rect-list stage does not take and forward the vertex clip distances through variables of their own, as the vertex shader writes them. With this change it passes 3 of 3, and so doagc_driver_rect_list_indirectandagc_rect_list_position_invariant.agc_driver_rect_list_indirectunder the Khronos validation layer (Ubuntu's 1.3.275), on NVIDIA: 2VUID-RuntimeSpirv-OpVariable-08746errors onmain, none with this change. The test passes its own checks either way. The layer reports two other errors on both builds, an unknown devicepNextstructure (this layer is older than the device's extensions) andVUID-VkGraphicsPipelineCreateInfo-pLibraries-06681; neither is about these stages.ctest
^agc_(684 tests): all pass.check_conventions.pypasses.pr_overlap.pylists Macos port #7201 and Macos m4 #6222 inRectListShaders.cpp, and the many PRs that add cases toGraphics.cpp. This PR's test case and helpers sit inrectListTestsand just above it, away from the barycentric case fix(shader): match barycentric tessellation clip interfaces #7330 edits; the two merge cleanly.Not checked on Windows, macOS, AMD or Intel.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code