fix(recompiler): start pixel waves without their helper invocations in EXEC #305
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/305"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-02T00:24:31Z.
What
A pixel wave starts with EXEC holding only its covered pixels. The other lanes of a partly covered quad run as helpers outside EXEC until the shader asks for whole quads (
s_wqm).emitEntryProloguestarts every stage withinitialExec = true, so a pixel shader starts with Vulkan's helper invocations in EXEC too. Helper invocations take part in subgroup operations, so on main they:v_mbcnt_*ranks,s_bcnt1of EXEC,v_readfirstlaneand the first-lane choices built on them;ds_append/ds_consumeor atomic. An atomic in a helper invocation does nothing and returns an undefined value.Changes:
StageInputKind::HelperInvocation, declared as theHelperInvocationbuiltin (bool) and read as 1/0.ShaderInfoCollectorcollects it and validates its component, andShaderValidationaccepts it as a fragment builtin.HelperInvocation == 0.s_wqmstill adds the helpers of every quad with a covered pixel, so derivative code keeps them, as on the GPU.Found on my integration branch: a PPSA21564 title-screen pixel shader allocates light-list nodes with a GDS
ds_appendand links them withimage_atomic_swap. With helpers in EXEC, a test of that pattern on the RTX 4090 saw waves reuse node indices (867 duplicates among 7817 pixels), which can link a node to itself. Main cannot bind GDS in shaders yet (#285 adds that), but the ballot and atomic cases above apply to any pixel shader.Tested
agc_driver_pixel_helper_lanesexecution test (tests/execution/PixelHelperLanes.cpp, so ctest runs it like the other tests there; it uses no GDS and no mesh shader). Like the other execution tests it exits 77 (skipped) without a Vulkan device, and it also skips on a subgroup narrower than 32 (lavapipe's is 8), which cannot hold a wave32.v_mbcnt_lo/hirank in EXEC, thes_bcnt1_i32_b64count of EXEC and thev_readfirstlane_b32of the pixel's index.pixel helper lanes wave64: the wave whose first lane is pixel 392 has 25 covered pixels, but pixel 584 is lane 2 of EXEC. With the fix it passes.agc_driver_mesh_testsandagc_driver_bda_device_testspass.ctest: 106/106 pass, including the execution tests.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repositoryShaderValidation.cpp; whichever merges second keeps both.