Mesa (staging/21.2): llvmpipe: take intersection with bbox for non-legacy points

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Aug 18 16:12:33 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: 7fc0e01cedd3e620888c76cff6b34e9c0dbcbf03
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7fc0e01cedd3e620888c76cff6b34e9c0dbcbf03

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Thu Aug 12 20:50:58 2021 +0200

llvmpipe: take intersection with bbox for non-legacy points

When I updated this code for multi-sampling, I missed one detail; if we
want to be able to support pipe_rasterizer_state::point_tri_clip, we
need to use the intersection of the bbox (clipped to the viewport
rectangle) and the generated primitive, otherwise we won't end up doing
x/y viewport clipping at all.

Because we've adjusted some of the parts of the bbox when adjusting for
inclusiveness/exclusiveness and fill-rule, we also need to reverse the
adjustment.

Fixes: f530e72ea05 ("llvmpipe: do not always use pixel-rounded coordinates for points")
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12350>
(cherry picked from commit 48b1b159ffe1f7864641b2a52d7f07e80149fd62)

---

 .pick_status.json                             | 2 +-
 src/gallium/drivers/llvmpipe/lp_setup_point.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 967ae805f49..117e6fbde8b 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -13,7 +13,7 @@
         "description": "llvmpipe: take intersection with bbox for non-legacy points",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "f530e72ea05f7fadf139df558f10d7ad9d38cc46"
     },
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_point.c b/src/gallium/drivers/llvmpipe/lp_setup_point.c
index bca2d47d135..d9123725a29 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_point.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_point.c
@@ -514,22 +514,22 @@ try_setup_point( struct lp_setup_context *setup,
 
       plane[0].dcdx = ~0U << 8;
       plane[0].dcdy = 0;
-      plane[0].c = -x[0];
+      plane[0].c = -MAX2(x[0], bbox.x0 << 8);
       plane[0].eo = 1 << 8;
 
       plane[1].dcdx = 1 << 8;
       plane[1].dcdy = 0;
-      plane[1].c = x[1];
+      plane[1].c = MIN2(x[1], (bbox.x1 + 1) << 8);
       plane[1].eo = 0;
 
       plane[2].dcdx = 0;
       plane[2].dcdy = 1 << 8;
-      plane[2].c = -y[0];
+      plane[2].c = -MAX2(y[0], (bbox.y0 << 8) - adj);
       plane[2].eo = 1 << 8;
 
       plane[3].dcdx = 0;
       plane[3].dcdy = ~0U << 8;
-      plane[3].c = y[1];
+      plane[3].c = MIN2(y[1], (bbox.y1 + 1) << 8);
       plane[3].eo = 0;
 
       if (!setup->legacy_points || setup->multisample) {



More information about the mesa-commit mailing list