From 72cf6cca914d95499a40c5257a5e2cdd26b89afa Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 17 Dec 2021 19:09:46 +0000 Subject: [PATCH] radv: allow inline push constants in more situations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't need to disable this path if there are indirect or 8/16/64-bit push constant loads. We can just use the default path for them. fossil-db (Sienna Cichlid): Totals from 21 (0.02% of 134621) affected shaders: CodeSize: 2028 -> 1884 (-7.10%) Instrs: 366 -> 363 (-0.82%); split: -2.46%, +1.64% Latency: 6630 -> 6579 (-0.77%) InvThroughput: 26520 -> 26316 (-0.77%) Copies: 84 -> 102 (+21.43%) PreSGPRs: 141 -> 222 (+57.45%) Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/vulkan/radv_shader_args.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/amd/vulkan/radv_shader_args.c b/src/amd/vulkan/radv_shader_args.c index 13397790dc8..e9b3d8e9a0c 100644 --- a/src/amd/vulkan/radv_shader_args.c +++ b/src/amd/vulkan/radv_shader_args.c @@ -123,14 +123,6 @@ allocate_inline_push_consts(const struct radv_shader_info *info, if (info->min_push_constant_used == UINT16_MAX) return; - /* Only supported if shaders don't have indirect push constants. */ - if (info->has_indirect_push_constants) - return; - - /* Only supported for 32-bit push constants. */ - if (!info->has_only_32bit_push_constants) - return; - uint8_t num_push_consts = (info->max_push_constant_used - info->min_push_constant_used) / 4; @@ -146,6 +138,7 @@ allocate_inline_push_consts(const struct radv_shader_info *info, user_sgpr_info->num_inline_push_consts = AC_MAX_INLINE_PUSH_CONSTS; if (user_sgpr_info->num_inline_push_consts == num_push_consts && + info->has_only_32bit_push_constants && !info->has_indirect_push_constants && !info->loads_dynamic_offsets) { /* Disable the default push constants path if all constants are * inlined and if shaders don't use dynamic descriptors.