fix(recompiler): give wave64 vertex programs on 32-lane hosts a 32-lane s3 #3546
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3546"
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 AlxcBTW on 2026-10-11T12:57:07Z.
What
Fixes #2783. A wave64 NGG vertex program on a 32-lane host subgroup stops on current
main:Titles that stop there on NVIDIA, and get past it with this change:
The program keys a full-wave OR on
lane < s3's primitive countand reads lanes 31 and 63. At one guest lane per invocation, lanes 32-63 have no invocation on a 32-lane host, but the vertex entry sets3 = 64 | 64 << 8.s3: for a wave64 vertex program on exactly 32 host lanes,emitEntryProloguesetss3 = 32 | 32 << 8, a wave the console can launch. The host subgroup width reachesShaderVertexInputInfoas it already reaches the compute and mesh inputs. Every cache key already carriesHostSubgroupSize. Wave32 programs and 64-lane hosts are unchanged.The read: with the narrowed
s3, the keys are 0 in lanes 32-63. When the strict rules don't match on a 32-lane host,MatchHalfWaveScanalso accepts:s_mov_b64 exec, -1;bound_ctrl:1row_shrsteps whose fill is the reduction's identity;Lane 63 then reads the identity, and lane 31 the subgroup reduction. Without subgroup arithmetic, lane 31 stays a shuffle.
TechnicalDebt: the two entries (vertex entry
s3, lanes outside the host subgroup) describe this.Related: #2261 (open) would route registered NGG programs to the mesh path, which would also cover this. #1825 only routes unregistered programs that use LDS or
s_barrier, and this program is registered.Tested
Windows 11 (26200), WinLibs GCC 15.2.0, Release, RTX 5070 Laptop (NVIDIA 616.92, 32-lane subgroups), on
main0f863c102:agc_shader_memory(verifyNarrowVertexWave): fails onmainwith the lane-63 error and passes with this branch. It also checks the cases that must still throw: a bound of 33, a count from user data, the vertex index instead of the lane, and a step into another register withoutbound_ctrl:1.agc_driver_ngg_vertex_wave_reduction: fails onmainwith the lane-63 error and passes with this branch. It skips on other subgroup widths.agc_driver*andagc_shader*on NVIDIA: 306/306.windows_exceptions, fails the same way onmain(CI run 38133926187), along with three Linux tests there.tools/check_conventions.py --base origin/mainpasses.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 repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:33:13Z.
Checked the bound_ctrl:1
row_shrscan and the culling program from the test verbatim on the HW oracle (gfx1035 wave64,s3counts 0/1/31/32/33/64: lane 63 reads 0 whenever the count is ≤ 32, and the bound_ctrl:1 fill is the identity for OR/add/umax; 0 mismatches).agc_shader_memoryandagc_driver_ngg_vertex_wave_reduction(forced to a 32-lane target on RADV withRADV_PERFTEST=gewave32) pass here and fail onmainwith the lane-63 error. Thanks @Tamalero and @MisterbALLIN for the runs on High on Life and Minecraft Dungeons II; merging.