Skip to content

nir/algebraic: add some Battlefront 2 optimizations

Rhys Perry requested to merge pendingchaos/mesa:nir_bf2_opts into master

Changes for the whole series on RADV/ACO (not just Battlefront 2 included):

Totals from affected shaders:
SGPRS: 37016 -> 37000 (-0.04 %)
VGPRS: 33384 -> 33176 (-0.62 %)
Spilled SGPRs: 70 -> 70 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 1994844 -> 1956684 (-1.91 %) bytes
LDS: 258 -> 258 (0.00 %) blocks
Max Waves: 4838 -> 4852 (0.29 %)

and RADV/LLVM:

Totals from affected shaders:
SGPRS: 28128 -> 28080 (-0.17 %)
VGPRS: 27928 -> 27992 (0.23 %)
Spilled SGPRs: 22 -> 22 (0.00 %)
Spilled VGPRs: 442 -> 487 (10.18 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 268 -> 396 (47.76 %) dwords per thread
Code Size: 1991084 -> 1963592 (-1.38 %) bytes
LDS: 463 -> 463 (0.00 %) blocks
Max Waves: 4449 -> 4444 (-0.11 %)

Unsure what to do about the first patch. It increases VGPR spilling with RADV/LLVM but eliminates VGPR spilling with RADV/ACO (since ACO doesn't implement VGPR spilling, this fixes Battlefront 2 compilation)

Merge request reports