Help wanted: cheaper wave64 mesh shaders on 32-lane GPUs #35

Open
opened 2026-11-27 03:14:46 +00:00 by github-bot · 2 comments
Owner

@⁠ThatRecompDev on GitHub · 2026-11-25 16:22 UTC · original

the console runs mesh shaders in 64-lane waves. on 32-lane GPUs we emulate that exactly with the "superstep" form (a dispatch loop with a group barrier at every wave operation), which is correct but slow: skinned mesh shaders like MSNC_VS_LinearDepthSkin take ~75 µs per round and some passes stall for seconds.

ideas we'd love help with:

  • an XCL-style compute pre-pass at [WaveSize(64)] on GPUs that support it, then a cheap mesh shader that just emits the results
  • proving more wave operations wave-size independent so fewer programs need the superstep form (WindowAnalysis / SkipRegion)
  • making --fast-waves safe: it's parked because one program (0194d7ba) can hang when a branch decided per hardware wave leads to paths with different barrier counts

background: docs/shader-translation.md (superstep form, fast waves, loop guard). AMD folks: #29 already lets RDNA run mesh shaders natively at 64.

**@⁠ThatRecompDev** on GitHub · 2026-11-25 16:22 UTC · [original](https://github.com/ThatRecompDev/five-star-recomp/issues/35) the console runs mesh shaders in 64-lane waves. on 32-lane GPUs we emulate that exactly with the "superstep" form (a dispatch loop with a group barrier at every wave operation), which is correct but slow: skinned mesh shaders like `MSNC_VS_LinearDepthSkin` take ~75 µs per round and some passes stall for seconds. ideas we'd love help with: - an XCL-style compute pre-pass at `[WaveSize(64)]` on GPUs that support it, then a cheap mesh shader that just emits the results - proving more wave operations wave-size independent so fewer programs need the superstep form (`WindowAnalysis` / `SkipRegion`) - making `--fast-waves` safe: it's parked because one program (0194d7ba) can hang when a branch decided per hardware wave leads to paths with different barrier counts background: `docs/shader-translation.md` (superstep form, fast waves, loop guard). AMD folks: #29 already lets RDNA run mesh shaders natively at 64.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 03:14:46 +00:00
Author
Owner

@⁠ThatRecompDev on GitHub · 2026-11-26 11:37 UTC · original

thanks, these are really well scoped

idea 2 is the one i'd start with, it's pure translator and the floor histogram makes it easy to measure. the readfirstlane-of-a-uniform-value case alone is 1,338 programs, so even a conservative "derived only from SGPRs / uniform loads" rule should move a lot of them off the superstep path

idea 1 is neat since msfb already does most of it. the extra compute pass + buffer per draw worries me a bit now that we're cutting per-draw overhead, but for the heavy mesh programs it would still win

if you want to take a stab at idea 2 a PR is very welcome, otherwise we'll pick it up

**@⁠ThatRecompDev** on GitHub · 2026-11-26 11:37 UTC · [original](https://github.com/ThatRecompDev/five-star-recomp/issues/35#issuecomment-7190972003) thanks, these are really well scoped idea 2 is the one i'd start with, it's pure translator and the floor histogram makes it easy to measure. the readfirstlane-of-a-uniform-value case alone is 1,338 programs, so even a conservative "derived only from SGPRs / uniform loads" rule should move a lot of them off the superstep path idea 1 is neat since msfb already does most of it. the extra compute pass + buffer per draw worries me a bit now that we're cutting per-draw overhead, but for the heavy mesh programs it would still win if you want to take a stab at idea 2 a PR is very welcome, otherwise we'll pick it up
Author
Owner

@⁠almostxxx27 on GitHub · 2026-11-27 11:20 UTC · original

#69

**@⁠almostxxx27** on GitHub · 2026-11-27 11:20 UTC · [original](https://github.com/ThatRecompDev/five-star-recomp/issues/35#issuecomment-7216953955) https://git.gtahub.st/github/ThatRecompDev--five-star-recomp/pulls/69
This discussion has been locked. Commenting is limited to contributors.
No description provided.