From: Marek Olšák Date: Sat, 22 Apr 2017 12:12:52 +0000 (+0200) Subject: radeonsi: don't load PrimID in TES if it's not used X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=678d568c7b2c1e7c92ce6b2800ff35be71e3ec0d;p=mesa.git radeonsi: don't load PrimID in TES if it's not used Reviewed-by: Nicolai Hähnle --- 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");