Mesa (staging/22.1): gallium/u_blitter: Fix depth.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 23 16:19:36 UTC 2022


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

Author: Timur Kristóf <timur.kristof at gmail.com>
Date:   Wed Jun  8 20:13:24 2022 +0200

gallium/u_blitter: Fix depth.

Fix the transform to make sure it doesn't disturb the depth range
of the blitted image. Set the Z coordinates of the vertices
by hand instead of relying on the transform to do it.

This is a pre-requisite to Zink always enabling depth clamping.

Fixes: 26c6640835936a77d87030ce8e90f9b9f5be783e
Signed-off-by: Timur Kristóf <timur.kristof at gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16929>
(cherry picked from commit 810135fb428a2505eba490b4d17a33629820e4e5)

Conflicts:
	src/gallium/drivers/lima/ci/lima-fails.txt

---

 .pick_status.json                          | 2 +-
 src/gallium/auxiliary/util/u_blitter.c     | 7 +++++--
 src/gallium/drivers/lima/ci/lima-fails.txt | 1 -
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 44208152aed..c635feda384 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1093,7 +1093,7 @@
         "description": "gallium/u_blitter: Fix depth.",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "26c6640835936a77d87030ce8e90f9b9f5be783e"
     },
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index bea898edcae..c160da9439d 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -846,14 +846,17 @@ static void blitter_set_rectangle(struct blitter_context_priv *ctx,
    ctx->vertices[3][0][0] = (float)x1 / ctx->dst_width * 2.0f - 1.0f; /*v3.x*/
    ctx->vertices[3][0][1] = (float)y2 / ctx->dst_height * 2.0f - 1.0f; /*v3.y*/
 
+   for (unsigned i = 0; i < 4; ++i)
+      ctx->vertices[i][0][2] = depth;
+
    /* viewport */
    struct pipe_viewport_state viewport;
    viewport.scale[0] = 0.5f * ctx->dst_width;
    viewport.scale[1] = 0.5f * ctx->dst_height;
-   viewport.scale[2] = 0.0f;
+   viewport.scale[2] = 1.0f;
    viewport.translate[0] = 0.5f * ctx->dst_width;
    viewport.translate[1] = 0.5f * ctx->dst_height;
-   viewport.translate[2] = depth;
+   viewport.translate[2] = 0.0f;
    viewport.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
    viewport.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
    viewport.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z;
diff --git a/src/gallium/drivers/lima/ci/lima-fails.txt b/src/gallium/drivers/lima/ci/lima-fails.txt
index 8d9fe6483be..7fdb9b35d1c 100644
--- a/src/gallium/drivers/lima/ci/lima-fails.txt
+++ b/src/gallium/drivers/lima/ci/lima-fails.txt
@@ -124,7 +124,6 @@ spec at arb_texture_cube_map@cubemap,Fail
 spec at arb_texture_cube_map@cubemap npot,Fail
 spec at arb_texture_cube_map@cubemap-shader,Fail
 spec at arb_texture_rectangle@1-1-linear-texture,Fail
-spec at arb_texture_rectangle@copyteximage rect,Fail
 spec at arb_texture_rectangle@copyteximage rect samples=2,Fail
 spec at arb_texture_rectangle@copyteximage rect samples=4,Fail
 spec at arb_texture_rectangle@glsl-fs-shadow2drect-01,Fail



More information about the mesa-commit mailing list