Mesh (NGG) programs refuse reads of SGPRs no hardware loads (s40 and up) as hardware SGPR inputs (66 vertex programs) #419

Closed
opened 2026-11-27 17:39:00 +00:00 by github-bot · 3 comments
Owner

@⁠tiagonogueiraa-bit on GitHub · 2026-11-27 17:23 UTC · original

A shape from #4: "a hardware SGPR input" in 66 guessed mesh-style (NGG) vertex programs of a 26,849-shader corpus (Series S, boot to the story load, main b998bb6).

What they read. Each reads an SGPR far above anything the hardware loads (s72, s77, s79 in the ones I traced) before any write on some path. These are registers the console compiler uses for spills and temporaries. For compute and pixel, Io::initialized_sgprs makes such reads 0 ("a register holds what the last wave left"). Mesh programs have no count, so every such read is refused.

Plan. Give mesh programs a count of 40. They have eight system SGPRs, then their user SGPRs from s8, and there are at most 32 of those: LLVM's AMDGPU::getMaxNumUserSGPRs on GFX9 and later. So nothing the hardware loads sits at s40 or above. Reads below s40 that no root parameter covers stay refused. The PR will have a test and a by-output sweep.

**@⁠tiagonogueiraa-bit** on GitHub · 2026-11-27 17:23 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/415) A shape from #4: "a hardware SGPR input" in 66 guessed mesh-style (NGG) vertex programs of a 26,849-shader corpus (Series S, boot to the story load, main `b998bb6`). **What they read.** Each reads an SGPR far above anything the hardware loads (s72, s77, s79 in the ones I traced) before any write on some path. These are registers the console compiler uses for spills and temporaries. For compute and pixel, `Io::initialized_sgprs` makes such reads 0 ("a register holds what the last wave left"). Mesh programs have no count, so every such read is refused. **Plan.** Give mesh programs a count of 40. They have eight system SGPRs, then their user SGPRs from s8, and there are at most 32 of those: LLVM's `AMDGPU::getMaxNumUserSGPRs` on GFX9 and later. So nothing the hardware loads sits at s40 or above. Reads below s40 that no root parameter covers stay refused. The PR will have a test and a by-output sweep.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 17:39:00 +00:00
Author
Owner

@⁠tiagonogueiraa-bit on GitHub · 2026-11-27 17:23 UTC · original

/claim

**@⁠tiagonogueiraa-bit** on GitHub · 2026-11-27 17:23 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/415#issuecomment-7224361243) /claim
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-27 17:24 UTC · original

Claimed by @⁠tiagonogueiraa-bit. Open a draft pull request with Refs #415 in its description within 24 hours, or the claim expires.

**@⁠github-actions[bot]** on GitHub · 2026-11-27 17:24 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/415#issuecomment-7224364793) Claimed by @⁠tiagonogueiraa-bit. Open a draft pull request with `Refs #415` in its description within 24 hours, or the claim expires.
github-bot referenced this issue from a commit 2026-11-28 00:29:35 +00:00
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-28 00:36 UTC · original

Thank you for this. It is fixed on main by 00c44adc. I have not checked every case from this report in the game myself, so please retest on main a6a58361 and reopen this if you still see it. Closing as fixed.

**@⁠LakshanSivakumar** on GitHub · 2026-11-28 00:36 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/415#issuecomment-7231046247) Thank you for this. It is fixed on main by 00c44adc. I have not checked every case from this report in the game myself, so please retest on main a6a58361 and reopen this if you still see it. Closing as fixed.
This discussion has been locked. Commenting is limited to contributors.
No description provided.