fix(recompiler): give vertex-path shaders a full NGG merged wave info #1412
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1412"
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 TheAggie on 2026-10-08T03:01:29Z.
What
On the vertex path (
ShaderPath::Vertex, PRIMGEN_EN), the translator's vertex entry set onlyv5(vertex index) andv8(instance index). The NGG merged wave info SGPRs3stayed 0. NGG shaders build their own EXEC from it. Mesa's ACO emits this at the start of every NGG vertex shader:With
s3= 0 both masks are empty, so the shader skipped its vertex fetch and position export and no geometry was rasterized.Each host invocation on this path is one vertex of a full wave, so the vertex entry now sets
s3towaveSize | waveSize << 8(vertex and primitive count of a full wave, wave index 0) when the program's user data starts ats8or later, i.e.s0–s7are system SGPRs as in NGG programs. Shaders that do not reads3are unaffected.agc_driver_ngg_vertex_wave_info: an execution test whose vertex shader starts with the prologue above, with user data ats8, and draws a full-screen triangle for wave64 and wave32. Without the change no pixel is written (the test fails with the target's fill value); with it every pixel is.Tested
Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, NVIDIA GeForce RTX 5070 Ti.
agc_*andshader_*tests pass, including the new one. They were run from the generatedCTestTestfile.cmakecommands, because antivirus blocksctest.exeon this machine.APS5_DUMP_FRAMES). Forcing the pixel shader output to a constant colour did not change that. The recompiled vertex shaders evaluated EXEC as the constant 0. With this change their geometry is rasterized. Other fixes are needed before these titles render completely; those follow in separate PRs.Not tested on AMD, Intel or Linux.
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 TheAggie on 2026-10-08T03:23:00Z.
Before/after frames from APS5_DUMP_FRAMES. Before: UI Lab presents black. After this change: the backdrop and the Showcase's HUD, particles and bloom render. The UI and the 3D scene still need the other pending fixes (#1413, #1414, #1415).



Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T13:08:15Z.
Checked on Linux (RADV): build and ctest green on current main, and
agc_driver_ngg_vertex_wave_infofails without the translator change and passes with it.Pushed one commit on top:
docs/dev/TechnicalDebt.md("Unknown function info"): thes3layout comes from the prologue Mesa's ACO emits, not from a measurement. The line also says thatuserDataBaseRegister >= 8is true for every graphics program here (firstUserSgpr = 8,DrawDecode.cpp), so it does not single out NGG shaders, and that a partial last wave still reports a full one.Merging once the CI runs (they were waiting for approval, I approved them) are green.
Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-08T13:18:04Z.
Tested on AMD under Linux, since this PR wasn't: RX 9070 XT (RDNA4, GFX1201), RADV / Mesa 26.2.4, Linux 7.2.9 (CachyOS), GCC Release build.
ctest: this PR merged ontomain07c2405c, all 453 tests pass withctest -j8(main alone: 452/452 on the same machine).main+ #759 (needed to boot this title onmain) + this PR, then one scripted run headless from boot through the title screen. No error and no amdgpu fault came from this change.main+ #759 alone: 226, 229, 226.storage image access to depth/stencil surface ... is not implemented(the gap #425 fills). So nothing past the title screen is covered.AI-assisted: the runs and this write-up were done by Claude (Claude Code) on my machine.