From 678d568c7b2c1e7c92ce6b2800ff35be71e3ec0d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 22 Apr 2017 14:12:52 +0200 Subject: [PATCH] radeonsi: don't load PrimID in TES if it's not used MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_state_shaders.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index 546bb44e123..6a6fce6939c 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -547,7 +547,7 @@ static void si_shader_es(struct si_screen *sscreen, struct si_shader *shader) vgpr_comp_cnt = shader->info.uses_instanceid ? 3 : 0; num_user_sgprs = SI_VS_NUM_USER_SGPR; } else if (shader->selector->type == PIPE_SHADER_TESS_EVAL) { - vgpr_comp_cnt = 3; /* all components are needed for TES */ + vgpr_comp_cnt = shader->selector->info.uses_primid ? 3 : 2; num_user_sgprs = SI_TES_NUM_USER_SGPR; } else unreachable("invalid shader selector type"); @@ -761,7 +761,7 @@ static void si_shader_gs(struct si_screen *sscreen, struct si_shader *shader) if (es_type == PIPE_SHADER_VERTEX) es_vgpr_comp_cnt = shader->info.uses_instanceid ? 3 : 0; else if (es_type == PIPE_SHADER_TESS_EVAL) - es_vgpr_comp_cnt = 3; /* all components are needed for TES */ + es_vgpr_comp_cnt = shader->key.part.gs.es->info.uses_primid ? 3 : 2; else unreachable("invalid shader selector type"); @@ -879,7 +879,7 @@ static void si_shader_vs(struct si_screen *sscreen, struct si_shader *shader, vgpr_comp_cnt = shader->info.uses_instanceid ? 3 : (enable_prim_id ? 2 : 0); num_user_sgprs = SI_VS_NUM_USER_SGPR; } else if (shader->selector->type == PIPE_SHADER_TESS_EVAL) { - vgpr_comp_cnt = 3; /* all components are needed for TES */ + vgpr_comp_cnt = shader->selector->info.uses_primid ? 3 : 2; num_user_sgprs = SI_TES_NUM_USER_SGPR; } else unreachable("invalid shader selector type"); -- 2.30.2