radv: allow inline push constants in more situations

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 <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12145>
This commit is contained in:
Rhys Perry
2021-12-17 19:09:46 +00:00
committed by Marge Bot
parent 9c7e750ffe
commit 72cf6cca91
+1 -8
View File
@@ -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.