radeonsi: move VGT_GS_MODE to the VS state
authorMarek Olšák <marek.olsak@amd.com>
Sun, 9 Aug 2015 22:52:21 +0000 (00:52 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 12 Aug 2015 23:25:26 +0000 (01:25 +0200)
The VS will want to select GS scenario A here (VS with PrimitiveID).

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_state_shaders.c

index 475aea1..a6480b3 100644 (file)
@@ -314,6 +314,12 @@ static void si_shader_vs(struct si_shader *shader)
        if (pm4 == NULL)
                return;
 
+       /* If this is the GS copy shader, the GS state writes this register.
+        * Otherwise, the VS state writes it.
+        */
+       if (!shader->is_gs_copy_shader)
+               si_pm4_set_reg(pm4, R_028A40_VGT_GS_MODE, 0);
+
        va = shader->bo->gpu_address;
        si_pm4_add_bo(pm4, shader->bo, RADEON_USAGE_READ, RADEON_PRIO_SHADER_DATA);
 
@@ -1287,8 +1293,6 @@ static void si_update_vgt_shader_config(struct si_context *sctx)
                }
 
                si_pm4_set_reg(*pm4, R_028B54_VGT_SHADER_STAGES_EN, stages);
-               if (!sctx->gs_shader)
-                       si_pm4_set_reg(*pm4, R_028A40_VGT_GS_MODE, 0);
        }
        si_pm4_bind_state(sctx, vgt_shader_config, *pm4);
 }