radeonsi: move smoothing to the main shader part to remove 1 live VGPR
authorMarek Olšák <marek.olsak@amd.com>
Mon, 13 Dec 2021 19:36:37 +0000 (14:36 -0500)
committerMarge Bot <emma+marge@anholt.net>
Wed, 5 Jan 2022 12:46:31 +0000 (12:46 +0000)
commit198ad7e4dc7e766ccfbd686bd23962d291c95c95
treec3a5e237c43cf31bfa14f4d7c12b2f5584eb6b43
parent12b942bd16439823107426fdbca05c9c19ae9a0f
radeonsi: move smoothing to the main shader part to remove 1 live VGPR

The samplemask VGPR that we had to pass to the epilog increased VGPR usage
by 1 for all shaders. Do it in the main function by using the mono key
structure, which causes on-demand compilation and stall, but we'll save
the VGPR.

57794 shaders in 35145 tests
Totals:
SGPRS: 2715856 -> 2716272 (0.02 %)
VGPRS: 1776168 -> 1718432 (-3.25 %)
Spilled SGPRs: 3704 -> 3630 (-2.00 %)
Spilled VGPRs: 1727 -> 1733 (0.35 %)
Private memory VGPRs: 256 -> 256 (0.00 %)
Scratch size: 2008 -> 2016 (0.40 %) dwords per thread
Code Size: 61429584 -> 61393288 (-0.06 %) bytes
Max Waves: 838645 -> 840484 (0.22 %)

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14266>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader.h
src/gallium/drivers/radeonsi/si_shader_internal.h
src/gallium/drivers/radeonsi/si_shader_llvm_ps.c
src/gallium/drivers/radeonsi/si_state_draw.cpp
src/gallium/drivers/radeonsi/si_state_shaders.cpp