mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-18 01:50:40 +01:00
llvmpipe: adjust scissor planes for multisample.
For the inclusive x0/y0 planes, add a half pixel adjustment For the exclusive x1/y1 planes, remove a half pixel adjustment Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12504>
This commit is contained in:
parent
519f235459
commit
a5786a2e71
4 changed files with 9 additions and 6 deletions
|
|
@ -1755,7 +1755,7 @@ lp_setup_flush_and_restart(struct lp_setup_context *setup)
|
|||
void
|
||||
lp_setup_add_scissor_planes(const struct u_rect *scissor,
|
||||
struct lp_rast_plane *plane_s,
|
||||
boolean s_planes[4])
|
||||
boolean s_planes[4], bool multisample)
|
||||
{
|
||||
/*
|
||||
* When rasterizing scissored tris, use the intersection of the
|
||||
|
|
@ -1778,11 +1778,13 @@ lp_setup_add_scissor_planes(const struct u_rect *scissor,
|
|||
* scissor edge this is, so rasterization would treat them differently
|
||||
* (easier to evaluate) to ordinary planes.)
|
||||
*/
|
||||
int adj = multisample ? 127 : 0;
|
||||
if (s_planes[0]) {
|
||||
int x0 = scissor->x0 - 1;
|
||||
plane_s->dcdx = ~0U << 8;
|
||||
plane_s->dcdy = 0;
|
||||
plane_s->c = x0 << 8;
|
||||
plane_s->c += adj;
|
||||
plane_s->c = -plane_s->c; /* flip sign */
|
||||
plane_s->eo = 1 << 8;
|
||||
plane_s++;
|
||||
|
|
@ -1792,7 +1794,7 @@ lp_setup_add_scissor_planes(const struct u_rect *scissor,
|
|||
plane_s->dcdx = 1 << 8;
|
||||
plane_s->dcdy = 0;
|
||||
plane_s->c = x1 << 8;
|
||||
plane_s->c += 255;
|
||||
plane_s->c += 127 + adj;
|
||||
plane_s->eo = 0 << 8;
|
||||
plane_s++;
|
||||
}
|
||||
|
|
@ -1801,6 +1803,7 @@ lp_setup_add_scissor_planes(const struct u_rect *scissor,
|
|||
plane_s->dcdx = 0;
|
||||
plane_s->dcdy = 1 << 8;
|
||||
plane_s->c = y0 << 8;
|
||||
plane_s->c += adj;
|
||||
plane_s->c = -plane_s->c; /* flip sign */
|
||||
plane_s->eo = 1 << 8;
|
||||
plane_s++;
|
||||
|
|
@ -1810,7 +1813,7 @@ lp_setup_add_scissor_planes(const struct u_rect *scissor,
|
|||
plane_s->dcdx = 0;
|
||||
plane_s->dcdy = ~0U << 8;
|
||||
plane_s->c = y1 << 8;
|
||||
plane_s->c += 255;
|
||||
plane_s->c += 127 + adj;
|
||||
plane_s->eo = 0;
|
||||
plane_s++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ scissor_planes_needed(boolean scis_planes[4], const struct u_rect *bbox,
|
|||
void
|
||||
lp_setup_add_scissor_planes(const struct u_rect *scissor,
|
||||
struct lp_rast_plane *plane_s,
|
||||
boolean s_planes[4]);
|
||||
boolean s_planes[4], bool multisample);
|
||||
|
||||
void lp_setup_choose_triangle( struct lp_setup_context *setup );
|
||||
void lp_setup_choose_line( struct lp_setup_context *setup );
|
||||
|
|
|
|||
|
|
@ -712,7 +712,7 @@ try_setup_line( struct lp_setup_context *setup,
|
|||
}
|
||||
|
||||
if (nr_planes > 4) {
|
||||
lp_setup_add_scissor_planes(scissor, &plane[4], s_planes);
|
||||
lp_setup_add_scissor_planes(scissor, &plane[4], s_planes, setup->multisample);
|
||||
}
|
||||
|
||||
return lp_setup_bin_triangle(setup, line, &bbox, &bboxpos, nr_planes, viewport_index);
|
||||
|
|
|
|||
|
|
@ -735,7 +735,7 @@ do_triangle_ccw(struct lp_setup_context *setup,
|
|||
}
|
||||
|
||||
if (nr_planes > 3) {
|
||||
lp_setup_add_scissor_planes(scissor, &plane[3], s_planes);
|
||||
lp_setup_add_scissor_planes(scissor, &plane[3], s_planes, setup->multisample);
|
||||
}
|
||||
|
||||
return lp_setup_bin_triangle(setup, tri, &bbox, &bboxpos, nr_planes, viewport_index);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue