summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-02-22 15:11:49 +0100
committerMarek Olšák <[email protected]>2015-02-24 21:21:04 +0100
commit53494371547392f3b9a836cdda66b5a1fdc9fda2 (patch)
treeb9cf09cf81acf76749642d10d66bca5e4b141d03 /src/gallium/drivers/radeonsi
parentffd701e677bf5df9315bd42a5f07585c7ad03d93 (diff)
radeonsi: only preload VertexID for the GS copy shader
The copy shader doesn't use any other preloaded VGPRs. Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r--src/gallium/drivers/radeonsi/si_state_shaders.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 5b463365c96..0a2ff2a2f03 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -159,12 +159,14 @@ static void si_shader_vs(struct si_shader *shader)
va = shader->bo->gpu_address;
si_pm4_add_bo(pm4, shader->bo, RADEON_USAGE_READ, RADEON_PRIO_SHADER_DATA);
- vgpr_comp_cnt = shader->uses_instanceid ? 3 : 0;
-
- if (shader->is_gs_copy_shader)
+ if (shader->is_gs_copy_shader) {
+ vgpr_comp_cnt = 0; /* only VertexID is needed for GS-COPY. */
num_user_sgprs = SI_GSCOPY_NUM_USER_SGPR;
- else
+ } else if (shader->selector->type == PIPE_SHADER_VERTEX) {
+ vgpr_comp_cnt = shader->uses_instanceid ? 3 : 0;
num_user_sgprs = SI_VS_NUM_USER_SGPR;
+ } else
+ assert(0);
num_sgprs = shader->num_sgprs;
if (num_user_sgprs > num_sgprs) {