radeonsi: don't emit PA_SC_LINE_STIPPLE if not rendering lines
authorMarek Olšák <marek.olsak@amd.com>
Sun, 15 Mar 2015 18:24:13 +0000 (19:24 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 16 Mar 2015 11:54:19 +0000 (12:54 +0100)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_state_draw.c

index 7523c2aefd203f70fc94276401585fc31dc9e2ce..e186694c5c318037a0da0b75bad2111a632c8117 100644 (file)
@@ -156,6 +156,14 @@ static void si_emit_rasterizer_prim_state(struct si_context *sctx)
        unsigned rast_prim = sctx->current_rast_prim;
        struct si_state_rasterizer *rs = sctx->emitted.named.rasterizer;
 
+       /* Skip this if not rendering lines. */
+       if (rast_prim != PIPE_PRIM_LINES &&
+           rast_prim != PIPE_PRIM_LINE_LOOP &&
+           rast_prim != PIPE_PRIM_LINE_STRIP &&
+           rast_prim != PIPE_PRIM_LINES_ADJACENCY &&
+           rast_prim != PIPE_PRIM_LINE_STRIP_ADJACENCY)
+               return;
+
        if (rast_prim == sctx->last_rast_prim &&
            rs->pa_sc_line_stipple == sctx->last_sc_line_stipple)
                return;