radeonsi: fix line stippling with LINES_ADJACENCY without GS
authorMarek Olšák <marek.olsak@amd.com>
Mon, 23 Nov 2020 21:24:59 +0000 (16:24 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 1 Dec 2020 20:33:03 +0000 (15:33 -0500)
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7721>

src/gallium/drivers/radeonsi/si_state_draw.c

index f3c88dd..6077740 100644 (file)
@@ -609,8 +609,11 @@ static void si_emit_rasterizer_prim_state(struct si_context *sctx)
       /* For lines, reset the stipple pattern at each primitive. Otherwise,
        * reset the stipple pattern at each packet (line strips, line loops).
        */
+      bool reset_per_prim = rast_prim == PIPE_PRIM_LINES ||
+                            rast_prim == PIPE_PRIM_LINES_ADJACENCY;
+      /* 0 = no reset, 1 = reset per prim, 2 = reset per packet */
       unsigned value =
-         rs->pa_sc_line_stipple | S_028A0C_AUTO_RESET_CNTL(rast_prim == PIPE_PRIM_LINES ? 1 : 2);
+         rs->pa_sc_line_stipple | S_028A0C_AUTO_RESET_CNTL(reset_per_prim ? 1 : 2);
 
       radeon_opt_set_context_reg(sctx, R_028A0C_PA_SC_LINE_STIPPLE, SI_TRACKED_PA_SC_LINE_STIPPLE,
                                  value);