Repository navigation
fix(agc): refuse last-vertex strips only for reads of a vertex slot - #5734
Conversation
|
Windows run, adding a title this unblocks. Windows 11 Pro 25H2, RTX 3080 (NVIDIA 591.86), WinLibs GCC 15.2.0, Ninja Release. Head
AI-assisted: yes |
|
Adding to babyhuey's run: the revert check and the rest of the homebrew catalog. Windows 11, RTX 4080 (NVIDIA 616.56), WinLibs GCC 15.2.0, Release, this head merged onto
AI-assisted: yes (Claude Code Opus 5.5) |
With fragmentShaderBarycentric (RADV, NVIDIA), v_interp_p1_f32 and v_interp_p2_f32 are translated as P0 + I * P10 + J * P20 over the per-vertex values, so every smooth input became per-vertex. A triangle strip drawn with PROVOKING_VTX_LAST then threw "last provoking vertex with explicit per-vertex triangle-strip interpolation is unsupported" for any shader that interpolates, which stops OliSe Player (PPSA01153) and RetroArch's ES-DE frontend (PPSA99169), both ps5-opengl titles whose shaders use only v_interp_p1/p2. I and J come from gl_BaryCoordKHR[1] and [2], in the same vertex order as the pervertexEXT values, so the result is b0 * v0 + b1 * v1 + b2 * v2 whatever order the device gives an odd strip triangle. Only a shader that reads a slot itself depends on that order. The translator now records the inputs read through v_interp_mov_f32 or 16-bit interpolation, FragmentParameter carries that as vertexOrder, and the strip check refuses those alone. 16-bit interpolation would cancel out the same way but has not been checked, so it stays refused.
A pixel shader that interpolates its input with v_interp_p1/p2 compiles to a per-vertex input without vertexOrder and passes a last-vertex strip; the same input read through v_interp_mov P10 is vertexOrder and still throws on a strip, not on a list. The synthetic matrix gets vertexOrder as a third axis. The first check fails with the guard on perVertex, the second without the v_interp_mov record.
5ea14b9 to
e4d0e2d
Compare
|
Rebased onto |
|
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.
|
|
Checked on Linux with the PR merged onto current |
What
With
fragmentShaderBarycentric(RADV, NVIDIA) the translator writesv_interp_p1_f32andv_interp_p2_f32asP0 + I * P10 + J * P20overpervertexEXTvalues, so every smooth pixel input is a per-vertex input.ValidateProvokingVertexrefuses a triangle strip drawn withPROVOKING_VTX_LASTwhen any input is per-vertex, so with GL's last-vertex convention every interpolating shader on a strip threw:That order question only matters to a shader that reads a slot itself.
IandJare loaded fromgl_BaryCoordKHR[1]and[2](InstructionTranslator.cpp,component + 1inSpirvModuleEmitter.cpp), in the same vertex order as thepervertexEXTarray thatP0,P10andP20come from (vertex 0, vertex 1 minus vertex 0, vertex 2 minus vertex 0). So av_interp_p1/p2pair givesb0 * v0 + b1 * v1 + b2 * v2whichever order the device puts an odd strip triangle in.v_interp_mov_f32or 16-bit interpolation inpixelVertexOrderInputs.FragmentParametercarries that asvertexOrder(cache encoder and its size assertion updated), and the strip check refuses only those.v_interp_movread. The flat-input check is unchanged.Titles. Both are ps5-opengl (Mesa) titles, and the shaders dumped from ES-DE's run use only
v_interp_p1_f32/v_interp_p2_f32:main. With this PR: 5 of 5 runs of 40 s without a stop, menu and scroller drawn at 59.94 fps.Fixes #5245.
Tested
Linux (Bazzite 44, GCC 16.2.1, Ninja, Release,
-DBUILD_TESTING=ON), based onmain315260903:ctest: 1105 of 1106 pass.agc_driver_tessellationsegfaults on unchangedmainhere too.agc_driver_graphicsrecompiles a pixel shader that interpolates one input withv_interp_p1/p2(per-vertex, notvertexOrder, accepted on a last-vertex strip) and one that reads it throughv_interp_movP10 (vertexOrder, refused on a strip, accepted on a list). The first check fails with the strip guard onperVertex, and the second fails without thev_interp_movrecord.tools/check_conventions.py --base upstream/mainpasses.tools/pr_overlap.pyreports feat(agc): replay proven finite stencil reference exports #5466 on the neighbouringstatic_assertline ofShaderDiskCache.cpp(CompiledShaderInfo); the two changes don't depend on each other, so whichever lands second keeps both values. Windows was not built here.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository