radeonsi: try to fix IA_MULTI_VGT_PARAM programming
authorMarek Olšák <marek.olsak@amd.com>
Tue, 29 Oct 2013 23:36:58 +0000 (00:36 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 4 Nov 2013 18:07:57 +0000 (19:07 +0100)
This doesn't make any difference on Bonaire, but it might help on Hawaii.

src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/si_state.h
src/gallium/drivers/radeonsi/si_state_draw.c

index 97710f01e7a8d01ac2cfec560e457764e26c680e..d23b28ab4000db81636c49398224446d6c7a6553 100644 (file)
@@ -525,6 +525,7 @@ static void *si_create_rs_state(struct pipe_context *ctx,
        rs->two_side = state->light_twoside;
        rs->multisample_enable = state->multisample;
        rs->clip_plane_enable = state->clip_plane_enable;
+       rs->line_stipple_enable = state->line_stipple_enable;
 
        polygon_dual_mode = (state->fill_front != PIPE_POLYGON_MODE_FILL ||
                                state->fill_back != PIPE_POLYGON_MODE_FILL);
index 6dbf8806b84283c8d4d250897ce9b87705945b6e..afd0388162ae1b3d558c5581d5e234e04102f2bc 100644 (file)
@@ -46,6 +46,7 @@ struct si_state_rasterizer {
        bool                    flatshade;
        bool                    two_side;
        bool                    multisample_enable;
+       bool                    line_stipple_enable;
        unsigned                sprite_coord_enable;
        unsigned                pa_sc_line_stipple;
        unsigned                pa_su_sc_mode_cntl;
index d20658ebafd1882cf7e74099116d4ebf8787afb4..1467bb69d4be90800d538ed5c347b73808c6cda4 100644 (file)
@@ -320,14 +320,18 @@ static bool si_update_draw_info_state(struct r600_context *rctx,
        }
 
        if (rctx->b.chip_class >= CIK) {
+               struct si_state_rasterizer *rs = rctx->queued.named.rasterizer;
                bool wd_switch_on_eop = prim == V_008958_DI_PT_POLYGON ||
                                        prim == V_008958_DI_PT_LINELOOP ||
                                        prim == V_008958_DI_PT_TRIFAN ||
                                        prim == V_008958_DI_PT_TRISTRIP_ADJ ||
-                                       info->primitive_restart;
+                                       info->primitive_restart ||
+                                       (rs ? rs->line_stipple_enable : false);
+               /* If the WD switch is false, the IA switch must be false too. */
+               bool ia_switch_on_eop = wd_switch_on_eop;
 
                si_pm4_set_reg(pm4, R_028AA8_IA_MULTI_VGT_PARAM,
-                              S_028AA8_SWITCH_ON_EOP(1) |
+                              S_028AA8_SWITCH_ON_EOP(ia_switch_on_eop) |
                               S_028AA8_PARTIAL_VS_WAVE_ON(1) |
                               S_028AA8_PRIMGROUP_SIZE(63) |
                               S_028AA8_WD_SWITCH_ON_EOP(wd_switch_on_eop));