[Mesa-dev] [PATCH 7/7] radv: do not add extra SGPR when push constants are not used

Samuel Pitoiset samuel.pitoiset at gmail.com
Mon Dec 18 18:38:58 UTC 2017


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 <samuel.pitoiset at gmail.com>
---
 src/amd/common/ac_shader_info.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/amd/common/ac_shader_info.c b/src/amd/common/ac_shader_info.c
index 6aadb5032e..ab5388fb53 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;
 
-- 
2.15.1



More information about the mesa-dev mailing list