draw: respect line_rectangular state
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 7 Jul 2021 21:44:44 +0000 (23:44 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 12 Jul 2021 22:05:10 +0000 (22:05 +0000)
Now that we have a separate flag to signal rectangular lines, let's use
that instead of the smooth-flag.

This should have the benefit of also drawing rectangular lines when
multisampling stippled, non-smooth lines. But it seems there were no
test for that, so no results to update.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11782>

src/gallium/auxiliary/draw/draw_pipe_stipple.c

index 386b764..eff9bcf 100644 (file)
@@ -50,7 +50,7 @@ struct stipple_stage {
    float counter;
    ushort pattern;
    ushort factor;
-   bool smooth;
+   bool rectangular;
 };
 
 
@@ -141,7 +141,7 @@ stipple_line(struct draw_stage *stage, struct prim_header *header)
    if (header->flags & DRAW_PIPE_RESET_STIPPLE)
       stipple->counter = 0;
 
-   if (stipple->smooth) {
+   if (stipple->rectangular) {
       float dx = x1 - x0;
       float dy = y1 - y0;
       length = sqrtf(dx*dx + dy*dy);
@@ -216,7 +216,7 @@ stipple_first_line(struct draw_stage *stage,
 
    stipple->pattern = draw->rasterizer->line_stipple_pattern;
    stipple->factor = draw->rasterizer->line_stipple_factor + 1;
-   stipple->smooth = draw->rasterizer->line_smooth;
+   stipple->rectangular = draw->rasterizer->line_rectangular;
 
    stage->line = stipple_line;
    stage->line(stage, header);