Mesa (staging/22.1): u_blitter/stencil: take dstbox x/y into accounts for dst fb width

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 21 18:54:05 UTC 2022


Module: Mesa
Branch: staging/22.1
Commit: 55d9bd1b648d1608a15d77d6b16babe8194fa00f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=55d9bd1b648d1608a15d77d6b16babe8194fa00f

Author: Dave Airlie <airlied at redhat.com>
Date:   Thu Apr 21 09:49:31 2022 +1000

u_blitter/stencil: take dstbox x/y into accounts for dst fb width

When setting the dst framebuffer width height, it might be silly
to constrain this beyond the dst resource, but at least constrain
it correctly to take account of x/y offsets.

This fixes some uses of this as a fallback for zink with
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_stencil_blit

Fixes: b4c07a8a87d0 ("gallium/util: allow scaling blits for stencil-fallback")
Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16069>
(cherry picked from commit dbc264f50418306650e9ec5a0b8613fe0aabb228)

---

 .pick_status.json                      | 2 +-
 src/gallium/auxiliary/util/u_blitter.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 1945c60f75f..168b8ee25a8 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -130,7 +130,7 @@
         "description": "u_blitter/stencil: take dstbox x/y into accounts for dst fb width",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "b4c07a8a87d06f2c347f204cac9fe708428e272d"
     },
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index a6b32a34e3c..aa10cec7706 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -2937,8 +2937,8 @@ util_blitter_stencil_fallback(struct blitter_context *blitter,
 
    /* set a framebuffer state */
    struct pipe_framebuffer_state fb_state = { 0 };
-   fb_state.width = dstbox->width;
-   fb_state.height = dstbox->height;
+   fb_state.width = dstbox->x + dstbox->width;
+   fb_state.height = dstbox->y + dstbox->height;
    fb_state.zsbuf = dst_view;
    pipe->set_framebuffer_state(pipe, &fb_state);
    pipe->set_sample_mask(pipe, ~0);



More information about the mesa-commit mailing list