aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2020-03-21 07:09:15 +1000
committerMarge Bot <[email protected]>2020-05-06 06:20:38 +0000
commit2d13591ba4d9df28ef2e90f90b8eda4ff6c7fc98 (patch)
treedf64da7192ff21e3790211a213c47d0648c3b725 /src/gallium
parent88851c4798a5ee57441cc5ad71d439a5b6f1a609 (diff)
llvmpipe: build 64-bit coverage mask in rasterizer
This adds the logic to build the per-sample masks at the lowest level of the rasterizer block hierarchy Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h b/src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h
index 05d2242786f..a905c1a14aa 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h
+++ b/src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h
@@ -46,10 +46,15 @@ TAG(do_block_4)(struct lp_rasterizer_task *task,
int x, int y,
const int64_t *c)
{
- unsigned mask = 0xffff;
int j;
+#ifndef MULTISAMPLE
+ unsigned mask = 0xffff;
+#else
+ uint64_t mask = UINT64_MAX;
+#endif
for (j = 0; j < NR_PLANES; j++) {
+#ifndef MULTISAMPLE
#ifdef RASTER_64
mask &= ~BUILD_MASK_LINEAR(((c[j] - 1) >> (int64_t)FIXED_ORDER),
-plane[j].dcdx >> FIXED_ORDER,
@@ -59,12 +64,28 @@ TAG(do_block_4)(struct lp_rasterizer_task *task,
-plane[j].dcdx,
plane[j].dcdy);
#endif
+#else
+ for (unsigned s = 0; s < 4; s++) {
+ int64_t new_c = (c[j]) + ((IMUL64(task->scene->fixed_sample_pos[s][1], plane[j].dcdy) + IMUL64(task->scene->fixed_sample_pos[s][0], -plane[j].dcdx)) >> FIXED_ORDER);
+ uint32_t build_mask;
+#ifdef RASTER_64
+ build_mask = BUILD_MASK_LINEAR((new_c - 1) >> (int64_t)FIXED_ORDER,
+ -plane[j].dcdx >> FIXED_ORDER,
+ plane[j].dcdy >> FIXED_ORDER);
+#else
+ build_mask = BUILD_MASK_LINEAR((new_c - 1),
+ -plane[j].dcdx,
+ plane[j].dcdy);
+#endif
+ mask &= ~((uint64_t)build_mask << (s * 16));
+ }
+#endif
}
/* Now pass to the shader:
*/
if (mask)
- lp_rast_shade_quads_mask(task, &tri->inputs, x, y, mask);
+ lp_rast_shade_quads_mask_sample(task, &tri->inputs, x, y, mask);
}
/**