Repository navigation
fix(recompiler): give vertex-path shaders a full NGG merged wave info - #1412
Merged
adriadam10 merged 2 commits intoOct 8, 2026
Merged
Conversation
This was referenced Oct 8, 2026
Contributor
Author
This was referenced Oct 8, 2026
The vertex entry set only the vertex and instance index VGPRs, leaving the NGG merged wave info SGPR s3 at 0. NGG shaders build EXEC from it (s_bfe_u64 exec, -1, <count in bits 16..22>), so Mesa's NGG vertex shaders ran with an empty EXEC and rasterized nothing. Each host invocation on the vertex path is one vertex of a full wave: when the user data starts at s8 or later, set s3 to the wave size as both vertex and primitive count, with wave index 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
|
Checked on Linux (RADV): build and ctest green on current main, and Pushed one commit on top:
Merging once the CI runs (they were waiting for approval, I approved them) are green. |
adriadam10
force-pushed
the
fix/recompiler-ngg-vertex-wave-info
branch
from
October 8, 2026 13:08
b666055 to
c394764
Compare
Contributor
|
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.
AI-assisted: the runs and this write-up were done by Claude (Claude Code) on my machine. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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