diff options
author | Marek Olšák <[email protected]> | 2017-05-01 17:34:41 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-05-03 22:58:27 +0200 |
commit | f466683cb07796fa89f96ef87a6f076218ae6db8 (patch) | |
tree | e9e880519b00a49db954e6e36fbeebb5a2cdc5e0 /src/gallium/drivers/radeonsi/si_state_shaders.c | |
parent | ec34632859f0420e0d1912357a96ec280ed87561 (diff) |
radeonsi/gfx9: fix gl_ViewportIndex
v2: remove unnecessary LLVMBuildAnd calls
Cc: 17.1 <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state_shaders.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state_shaders.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index e4794220913..b80a3478caf 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -867,8 +867,17 @@ static void si_shader_vs(struct si_screen *sscreen, struct si_shader *shader, * not sent again. */ if (!gs) { - si_pm4_set_reg(pm4, R_028A40_VGT_GS_MODE, - S_028A40_MODE(enable_prim_id ? V_028A40_GS_SCENARIO_A : 0)); + unsigned mode = 0; + + /* PrimID needs GS scenario A. + * GFX9 also needs it when ViewportIndex is enabled. + */ + if (enable_prim_id || + (sscreen->b.chip_class >= GFX9 && + shader->selector->info.writes_viewport_index)) + mode = V_028A40_GS_SCENARIO_A; + + si_pm4_set_reg(pm4, R_028A40_VGT_GS_MODE, S_028A40_MODE(mode)); si_pm4_set_reg(pm4, R_028A84_VGT_PRIMITIVEID_EN, enable_prim_id); } else { si_pm4_set_reg(pm4, R_028A40_VGT_GS_MODE, si_vgt_gs_mode(gs)); |