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 <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
This commit is contained in:
Dave Airlie 2020-03-21 07:09:15 +10:00 committed by Marge Bot
parent 88851c4798
commit 2d13591ba4
1 changed files with 23 additions and 2 deletions

View File

@ -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,
@ -58,13 +63,29 @@ TAG(do_block_4)(struct lp_rasterizer_task *task,
mask &= ~BUILD_MASK_LINEAR((c[j] - 1),
-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);
}
/**