Repository navigation
Description
What
Under Proton, Mesa's ACO compiler needs more VGPRs than clean/dx12/vgpr_limits.json allows for three of Model M's heaviest kernels. Per vgpr_limits.json's own note, they then fit one 256-lane workgroup per CU instead of two:
| Kernel | VGPRs under ACO | Bound | Waves/SIMD | GPU time per frame |
|---|---|---|---|---|
swin_block_c64_nc |
240 | 192 | 6 | 0.30 ms |
swin_block_c96_pm_rev_nc |
256 | 192 | 5 | 0.26 ms |
bneck/swin_bneck6_mbo_nc |
256 | 192 | 5 | 0.43 ms |
swin_block_c96_add_xe_xo_nc |
192 | 192 | 8 | 0.21 ms |
d1p12/swin_block_c64_add_dec0_nc |
192 | 192 | 8 | 0.43 ms |
That's about 1.0 ms of Model M's roughly 2.3 ms on the direct route, at 1706×960 → 2560×1440. The repository's notes put a lost workgroup per CU at +38 µs (swin_block_c96_add_xe_* at 215 VGPRs) to +103 µs (dec0 at 201/215 VGPRs) per frame at 1440p Quality. So this is probably a few tenths of a millisecond on Linux. I haven't measured that directly: I can't force ACO to 192 VGPRs to compare.
It isn't loop unrolling. That was my first guess, because of the "unroll loops despite [loop]" note in clean/dx12/README.md, so I checked:
swin_block_c64_nc's DXIL has no loops at all: DXC already unrolled it, so AMD's Windows compiler gets the same straight-line code and fits it in ≤192 VGPRs (the build's RGA check).swin_block_c96_pm_rev_ncand the bottleneck keep their loops under ACO (2 and 8 back-edges).
So it's ACO's register allocation on these large kernels. Before scheduling it's already about 198 VGPRs for c64, and 194 and 230 for the other two.
How it was measured (synthetic data only)
- RX 9070 XT, Mesa RADV 27.0.0-devel, GE-Proton 11-11's Wine, vkd3d-proton
5b1089c8with dxil-spirv #362 (dxil-spirv114e664eplus the PR). - Kernels built from main's
clean/dx12/kernels(unchanged since a8500cb) withbuild_dx12.py. native_direct_test(direct route, check mode, 3 frames) run under Wine withRADV_DEBUG=shaderstats(VGPRs, waves, LDS) andRADV_DEBUG=shaders(ACO's ISA).- Kernels matched by their WMMA count: each SPIR-V cooperative-matrix multiply-add becomes two
v_wmmain ACO's ISA (736, 560 and 1312 for the three), and by LDS size where that could be read. - GPU times are from
WG_D3D12_PROFILEin the same harness. Profiling adds overhead, so treat them as rough.
What could be done (your call):
- Restructure these kernels so they need fewer registers on any compiler. That would change the Windows DXIL too.
- Report it to Mesa (ACO) with these kernels' SPIR-V as a reproducer. They're WrongGPU's own MIT-licensed code, so the SPIR-V can be shared. I can put that together if you'd rather it went that way.
- Leave it. On Linux this is a few tenths of a millisecond, not a correctness problem.
Activity
j0nsh1n commentedon Nov 14, 2026
A follow-up for RR, for completeness. Under RADV/ACO, four of RR's accurate-mode body kernels also go over their register budget:
stagee.E4,stagee.E5,stagee.D4-Fandstagee.D4-R, the 512-lanewide4andw4p15broutes. They are capped at 192 VGPRs and spill 59-89 VGPRs to scratch (4.9-8.4 KB).The cap comes from RADV, which compiles every compute shader that uses LDS in CU mode (
radv_should_use_wgp_mode: "LDS is faster with CU mode"). A 512-lane group then has 192 VGPRs per wave. The notes instage.pygive 190-192 with no spill from AMD's compiler.It doesn't seem to cost anything measurable. Timing each stage with
clean/rr_f/gpu/bench.pyunder Proton (vkd3d-proton 5b1089c8, the runtime'sstagee.*kernels at 1706x960, best of 20 runs) gives these four stages 0.20 ms together, against 0.27 ms in the 2026-10-18 table inclean/rr_f/gpu/README.md. The whole body comes to 4.09 ms best and 4.50 ms on average, and every stage is at or below that table. So I don't think it's worth any work. I'm noting it only so that the spills aren't a surprise if someone reads ACO's stats.🤖 Generated with Claude Code
phantoslayer21 commentedon Nov 14, 2026
Thanks. The table and the unrolling check save a lot of guessing. Labelled performance / Linux, milestone Later.
The register allocation is ACO's, so the options are an upstream Mesa report, or Linux-only variants of these kernels that fit under the bound. We'd do the second only for a measured in-game difference. The most useful next number is Model M's per-kernel GPU time in a game under Proton, next to Windows on the same card.
The RR follow-up is noted too: no measurable cost, so nothing to change there for now.