llvmpipe: add new rast api to pass full 64-bit mask.
authorDave Airlie <airlied@redhat.com>
Fri, 20 Mar 2020 21:07:53 +0000 (07:07 +1000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 6 May 2020 06:20:38 +0000 (06:20 +0000)
The 64-bit mask is a 16-bit mask per sample for up to 4 samples.

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 c4c5053be78d4183f9aab47bd3886a97c5bd6041..4273e1522967fb9e4cb16842644fb74966005e5d 100644 (file)
@@ -413,10 +413,10 @@ lp_rast_shade_tile_opaque(struct lp_rasterizer_task *task,
  * \param y  Y position of quad in window coords
  */
 void
-lp_rast_shade_quads_mask(struct lp_rasterizer_task *task,
-                         const struct lp_rast_shader_inputs *inputs,
-                         unsigned x, unsigned y,
-                         unsigned mask)
+lp_rast_shade_quads_mask_sample(struct lp_rasterizer_task *task,
+                                const struct lp_rast_shader_inputs *inputs,
+                                unsigned x, unsigned y,
+                                uint64_t mask)
 {
    const struct lp_rast_state *state = task->state;
    struct lp_fragment_shader_variant *variant = state->variant;
@@ -482,7 +482,7 @@ lp_rast_shade_quads_mask(struct lp_rasterizer_task *task,
                                             GET_DADY(inputs),
                                             color,
                                             depth,
-                                            (uint64_t)mask,
+                                            mask,
                                             &task->thread_data,
                                             stride,
                                             depth_stride,
@@ -492,7 +492,17 @@ lp_rast_shade_quads_mask(struct lp_rasterizer_task *task,
    }
 }
 
-
+void
+lp_rast_shade_quads_mask(struct lp_rasterizer_task *task,
+                         const struct lp_rast_shader_inputs *inputs,
+                         unsigned x, unsigned y,
+                         unsigned mask)
+{
+   uint64_t new_mask = 0;
+   for (unsigned i = 0; i < task->scene->fb_max_samples; i++)
+      new_mask |= ((uint64_t)mask) << (16 * i);
+   lp_rast_shade_quads_mask_sample(task, inputs, x, y, new_mask);
+}
 
 /**
  * Begin a new occlusion query.
index 6c962ffdc52b669098a0ba2a61be2f74cc907b0a..6055aad8450ca89294504b1df3398956e0840015 100644 (file)
@@ -131,7 +131,11 @@ struct lp_rasterizer
    util_barrier barrier;
 };
 
-
+void
+lp_rast_shade_quads_mask_sample(struct lp_rasterizer_task *task,
+                                const struct lp_rast_shader_inputs *inputs,
+                                unsigned x, unsigned y,
+                                uint64_t mask);
 void
 lp_rast_shade_quads_mask(struct lp_rasterizer_task *task,
                          const struct lp_rast_shader_inputs *inputs,