diff options
author | Marek Olšák <[email protected]> | 2019-08-20 20:56:22 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-08-27 16:16:08 -0400 |
commit | 28f44ee5339f8a6f822d84b7beaec9406d4279e6 (patch) | |
tree | 681045139068a105f06bdf35a1be1b260b660b45 /src | |
parent | e121d75de9eb8f14e1b33a50a4eb12e2b34e8881 (diff) |
radeonsi/gfx10: fix InstanceID for legacy VS+GS
Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state_shaders.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index def27b1e685..15070055ada 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -878,10 +878,15 @@ static void si_shader_gs(struct si_screen *sscreen, struct si_shader *shader) unsigned es_type = shader->key.part.gs.es->type; unsigned es_vgpr_comp_cnt, gs_vgpr_comp_cnt; - if (es_type == PIPE_SHADER_VERTEX) - /* VGPR0-3: (VertexID, InstanceID / StepRate0, ...) */ - es_vgpr_comp_cnt = shader->info.uses_instanceid ? 1 : 0; - else if (es_type == PIPE_SHADER_TESS_EVAL) + if (es_type == PIPE_SHADER_VERTEX) { + /* GFX10: (VertexID, UserVGPR0, UserVGPR1, UserVGPR2 or InstanceID) + * GFX9: (VertexID, InstanceID / StepRate0, ...) + */ + if (sscreen->info.chip_class >= GFX10) + es_vgpr_comp_cnt = shader->info.uses_instanceid ? 3 : 0; + else + es_vgpr_comp_cnt = shader->info.uses_instanceid ? 1 : 0; + } else if (es_type == PIPE_SHADER_TESS_EVAL) es_vgpr_comp_cnt = shader->key.part.gs.es->info.uses_primid ? 3 : 2; else unreachable("invalid shader selector type"); |