summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-04-22 14:12:52 +0200
committerMarek Olšák <[email protected]>2017-04-28 21:47:35 +0200
commit678d568c7b2c1e7c92ce6b2800ff35be71e3ec0d (patch)
tree60342c8b261ed02508df0e4a9d23fc060c9794a0 /src
parent808c33f6f0bf55ed93ec2cf540ca66170dca1a3b (diff)
radeonsi: don't load PrimID in TES if it's not used
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeonsi/si_state_shaders.c6
1 files 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");