Mesa (main): llvmpipe: always use draw_regions intersection

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 21 21:59:11 UTC 2021


Module: Mesa
Branch: main
Commit: 43ccc6c091a72cb94327688c299f8068838b9e81
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=43ccc6c091a72cb94327688c299f8068838b9e81

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Mon Jul 19 17:32:17 2021 +0200

llvmpipe: always use draw_regions intersection

This was still used in the linear branch, since it works all a little
differently there (in particular, when using guard band we have to
intersect the draw regions with the viewport, since draw won't clip
for us). However, we should always intersect with draw_regions
(regardless if that includes the intersection with vp or not), since
the viewport can be larger than the fb size, and we don't want to
draw outside the fb (usually harmless, but important for occlusion
queries and shader image/buffer writes).

This fixes various dEQP-GLES31.functional.fbo.no_attachments failures
(which uses oversized viewport with occlusion queries).
The other ci changes aren't really bugs (the humus/Portals image
looks the same, we cannot expect bit-identical results, and
for the piglit quad-invariance test, I think we merely passed it
by accident since our interpolation may give different results
depending on where on the screen a tri is regardless of linear
rasterizer).

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11969>

---

 src/gallium/drivers/llvmpipe/ci/llvmpipe-quick_gl.txt | 1 +
 src/gallium/drivers/llvmpipe/ci/traces-llvmpipe.yml   | 2 +-
 src/gallium/drivers/llvmpipe/lp_setup.c               | 2 --
 src/gallium/drivers/llvmpipe/lp_setup_context.h       | 1 -
 src/gallium/drivers/llvmpipe/lp_setup_line.c          | 8 +++-----
 src/gallium/drivers/llvmpipe/lp_setup_tri.c           | 8 +++-----
 6 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/ci/llvmpipe-quick_gl.txt b/src/gallium/drivers/llvmpipe/ci/llvmpipe-quick_gl.txt
index fa2d1f70e6e..9c54c6a0eb4 100644
--- a/src/gallium/drivers/llvmpipe/ci/llvmpipe-quick_gl.txt
+++ b/src/gallium/drivers/llvmpipe/ci/llvmpipe-quick_gl.txt
@@ -152,6 +152,7 @@ spec/!opengl 1.1/polygon-mode-offset/config 4: expected white pixel on bottom ed
 spec/!opengl 1.1/polygon-mode-offset/config 4: expected white pixel on left edge: fail
 spec/!opengl 1.1/polygon-mode-offset/config 4: expected white pixel on right edge: fail
 spec/!opengl 1.1/polygon-mode-offset/config 4: expected white pixel on top edge: fail
+spec/!opengl 1.1/quad-invariance: warn
 spec/!opengl 1.1/read-front: fail
 spec/!opengl 1.1/read-front clear-front-first: fail
 spec/!opengl 1.1/read-front clear-front-first samples=16: skip
diff --git a/src/gallium/drivers/llvmpipe/ci/traces-llvmpipe.yml b/src/gallium/drivers/llvmpipe/ci/traces-llvmpipe.yml
index 62d70d4bd0d..d159eea0350 100644
--- a/src/gallium/drivers/llvmpipe/ci/traces-llvmpipe.yml
+++ b/src/gallium/drivers/llvmpipe/ci/traces-llvmpipe.yml
@@ -45,7 +45,7 @@ traces:
   - path: humus/Portals.trace
     expectations:
       - device: gl-vmware-llvmpipe
-        checksum: e46ba031e63d55209469f20019657baa
+        checksum: c4a0f928e0cedf91726728e7fd5d9759
   - path: bgfx/01-cubes.rdc
     expectations:
       - device: gl-vmware-llvmpipe
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index 4c0c0ad50e9..dbf59e39ed1 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -1383,7 +1383,6 @@ try_update_scene_state( struct lp_setup_context *setup )
 
    if (setup->dirty & LP_SETUP_NEW_SCISSOR) {
       unsigned i;
-      setup->scissor_or_vp_clip = setup->scissor_test;
 
       for (i = 0; i < PIPE_MAX_VIEWPORTS; ++i) {
          setup->draw_regions[i] = setup->framebuffer;
@@ -1397,7 +1396,6 @@ try_update_scene_state( struct lp_setup_context *setup )
          boolean need_vp_scissoring = !!memcmp(&setup->vpwh, &setup->framebuffer,
                                                sizeof(setup->framebuffer));
          assert(setup->viewport_index_slot < 0);
-         setup->scissor_or_vp_clip |= need_vp_scissoring;
          if (need_vp_scissoring) {
             u_rect_possible_intersection(&setup->vpwh,
                                          &setup->draw_regions[0]);
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_context.h b/src/gallium/drivers/llvmpipe/lp_setup_context.h
index fe645fc9516..a7273a2ad93 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_context.h
+++ b/src/gallium/drivers/llvmpipe/lp_setup_context.h
@@ -99,7 +99,6 @@ struct lp_setup_context
    unsigned flatshade_first:1;
    unsigned ccw_is_frontface:1;
    unsigned scissor_test:1;
-   unsigned scissor_or_vp_clip:1;
    unsigned point_tri_clip:1;
    unsigned point_size_per_vertex:1;
    unsigned legacy_points:1;
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_line.c b/src/gallium/drivers/llvmpipe/lp_setup_line.c
index 2688c60ee70..2d1b9541629 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_line.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_line.c
@@ -604,11 +604,9 @@ try_setup_line( struct lp_setup_context *setup,
     * Determine how many scissor planes we need, that is drop scissor
     * edges if the bounding box of the tri is fully inside that edge.
     */
-   if (setup->scissor_or_vp_clip) {
-      scissor = &setup->draw_regions[viewport_index];
-      scissor_planes_needed(s_planes, &bboxpos, scissor);
-      nr_planes += s_planes[0] + s_planes[1] + s_planes[2] + s_planes[3];
-   }
+   scissor = &setup->draw_regions[viewport_index];
+   scissor_planes_needed(s_planes, &bboxpos, scissor);
+   nr_planes += s_planes[0] + s_planes[1] + s_planes[2] + s_planes[3];
 
    line = lp_setup_alloc_triangle(scene,
                                   key->num_inputs,
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index 56494d49a93..a31e77e5213 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@ -344,11 +344,9 @@ do_triangle_ccw(struct lp_setup_context *setup,
     * Determine how many scissor planes we need, that is drop scissor
     * edges if the bounding box of the tri is fully inside that edge.
     */
-   if (setup->scissor_or_vp_clip) {
-      scissor = &setup->draw_regions[viewport_index];
-      scissor_planes_needed(s_planes, &bboxpos, scissor);
-      nr_planes += s_planes[0] + s_planes[1] + s_planes[2] + s_planes[3];
-   }
+   scissor = &setup->draw_regions[viewport_index];
+   scissor_planes_needed(s_planes, &bboxpos, scissor);
+   nr_planes += s_planes[0] + s_planes[1] + s_planes[2] + s_planes[3];
 
    tri = lp_setup_alloc_triangle(scene,
                                  key->num_inputs,



More information about the mesa-commit mailing list