radv: add support for push constants inlining when possible

Graphics / Mesa 3D Graphics Library / Mesa - Samuel Pitoiset [gmail.com] - 12 February 2019 16:25 EST

This removes some scalar loads from shaders, but it increases the number of SET_SH_REG packets. This is currently basic but it could be improved if needed. Inlining dynamic offsets might also help.

Original idea from Dave Airlie.

29077 shaders in 15096 tests Totals: SGPRS: 1321325 -> 1357101 (2.71 %)
VGPRS: 936000 -> 932576 (-0.37 %) Spilled SGPRs: 24804 -> 24791 (-0.05 %) Code Size: 49827960 -> 49642232 (-0.37 %) bytes Max Waves: 242007 -> 242700 (0.29 %)

Totals from affected shaders: SGPRS: 290989 -> 326765 (12.29 %)
VGPRS: 244680 -> 241256 (-1.40 %) Spilled SGPRs: 1442 -> 1429 (-0.90 %) Code Size: 8126688 -> 7940960 (-2.29 %) bytes Max Waves: 80952 -> 81645 (0.86 %)

bd1186572f6 radv: add support for push constants inlining when possible
src/amd/common/ac_nir_to_llvm.c | 27 +++++++++++--
src/amd/common/ac_shader_abi.h | 5 +++
src/amd/vulkan/radv_cmd_buffer.c | 79 ++++++++++++++++++++++++++++-----------
src/amd/vulkan/radv_nir_to_llvm.c | 58 ++++++++++++++++++++++++++++
src/amd/vulkan/radv_shader.h | 11 ++++--
5 files changed, 152 insertions(+), 28 deletions(-)

Upstream: cgit.freedesktop.org


  • Share