summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-12-18 19:38:58 +0100
committerSamuel Pitoiset <[email protected]>2017-12-19 21:22:18 +0100
commit0c4a30eb51d0affe85ff9bd80b733ca5285221e1 (patch)
treeb4a72c6e7fbe3ed39141f3140d9cb575e3b80f0e /src/amd
parent39097282f738f00ad1e5e44791907db43d3e4c7c (diff)
radv: do not add extra SGPR when push constants are not used
This is not because the vertex stage needs some push constants that other stages need them too. This should reduce the number of loaded SGPRs in some situations. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/common/ac_shader_info.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/amd/common/ac_shader_info.c b/src/amd/common/ac_shader_info.c
index 6aadb5032e2..ab5388fb53f 100644
--- a/src/amd/common/ac_shader_info.c
+++ b/src/amd/common/ac_shader_info.c
@@ -149,7 +149,8 @@ ac_nir_shader_info_pass(struct nir_shader *nir,
struct nir_function *func = (struct nir_function *)exec_list_get_head(&nir->functions);
info->needs_push_constants = false;
- if (options->layout->push_constant_size ||
+ if ((options->layout->push_constant_size &&
+ options->layout->push_constant_stages & (1 << nir->info.stage)) ||
options->layout->dynamic_offset_count)
info->needs_push_constants = true;