From: Dave Airlie Date: Fri, 20 Mar 2020 21:09:15 +0000 (+1000) Subject: llvmpipe: build 64-bit coverage mask in rasterizer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2d13591ba4d9df28ef2e90f90b8eda4ff6c7fc98;p=mesa.git 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 Part-of: --- 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, @@ -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); } /**