llvmpipe: fixup multisample coverage masks for covered tiles
authorDave Airlie <airlied@redhat.com>
Fri, 20 Mar 2020 21:16:35 +0000 (07:16 +1000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 6 May 2020 06:20:38 +0000 (06:20 +0000)
For fully covered tiles just pass in the filled out mask.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>

src/gallium/drivers/llvmpipe/lp_rast.c
src/gallium/drivers/llvmpipe/lp_rast_priv.h

index 4273e1522967fb9e4cb16842644fb74966005e5d..551b517fbb24ee64295c28ee4239d0d47d370b2e 100644 (file)
@@ -361,6 +361,10 @@ lp_rast_shade_tile(struct lp_rasterizer_task *task,
             depth_sample_stride = scene->zsbuf.sample_stride;
          }
 
+         uint64_t mask = 0;
+         for (unsigned i = 0; i < scene->fb_max_samples; i++)
+            mask |= (uint64_t)(0xffff) << (16 * i);
+
          /* Propagate non-interpolated raster state. */
          task->thread_data.raster_state.viewport_index = inputs->viewport_index;
 
@@ -374,7 +378,7 @@ lp_rast_shade_tile(struct lp_rasterizer_task *task,
                                             GET_DADY(inputs),
                                             color,
                                             depth,
-                                            (uint64_t)0xffff,
+                                            mask,
                                             &task->thread_data,
                                             stride,
                                             depth_stride,
index 6055aad8450ca89294504b1df3398956e0840015..de8527ae0c63ac400319d19afc99e3f44c367af1 100644 (file)
@@ -261,6 +261,10 @@ lp_rast_shade_quads_all( struct lp_rasterizer_task *task,
       depth_stride = scene->zsbuf.stride;
    }
 
+   uint64_t mask = 0;
+   for (unsigned i = 0; i < scene->fb_max_samples; i++)
+      mask |= (uint64_t)0xffff << (16 * i);
+
    /*
     * The rasterizer may produce fragments outside our
     * allocated 4x4 blocks hence need to filter them out here.
@@ -279,7 +283,7 @@ lp_rast_shade_quads_all( struct lp_rasterizer_task *task,
                                          GET_DADY(inputs),
                                          color,
                                          depth,
-                                         (uint64_t)0xffff,
+                                         mask,
                                          &task->thread_data,
                                          stride,
                                          depth_stride,