diff options
author | Timur Kristóf <timur.kristof@gmail.com> | 2022-06-08 20:13:24 +0200 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-06-21 15:44:54 +0000 |
commit | 810135fb428a2505eba490b4d17a33629820e4e5 (patch) | |
tree | a39462b8763d8633d776642bcf64c499f486478c | |
parent | ee491967c3c9922e9be32df5c956388c6e006b43 (diff) |
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@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16929>
-rw-r--r-- | src/gallium/auxiliary/util/u_blitter.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/lima/ci/lima-fails.txt | 3 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index f55c580fec7..0e9a7837722 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -844,14 +844,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 d8f83aafc38..de8ae03d26e 100644 --- a/src/gallium/drivers/lima/ci/lima-fails.txt +++ b/src/gallium/drivers/lima/ci/lima-fails.txt @@ -125,7 +125,6 @@ spec@arb_texture_cube_map@cubemap,Fail spec@arb_texture_cube_map@cubemap npot,Fail spec@arb_texture_cube_map@cubemap-shader,Fail spec@arb_texture_rectangle@1-1-linear-texture,Fail -spec@arb_texture_rectangle@copyteximage rect,Fail spec@arb_texture_rectangle@copyteximage rect samples=2,Fail spec@arb_texture_rectangle@copyteximage rect samples=4,Fail spec@arb_texture_rectangle@glsl-fs-shadow2drect-01,Fail @@ -573,8 +572,6 @@ spec@!opengl 1.0@gl-1.0-scissor-bitmap,Fail spec@!opengl 1.0@gl-1.0-spot-light,Fail spec@!opengl 1.0@gl-1.0-swapbuffers-behavior,Fail spec@!opengl 1.0@gl-1.0-user-clip-all-planes,Fail -spec@!opengl 1.1@copyteximage 1d,Fail -spec@!opengl 1.1@copyteximage 2d,Fail spec@!opengl 1.1@gl-1.1-xor-copypixels,Fail spec@!opengl 1.1@gl-1.1-xor,Fail spec@!opengl 1.1@line-flat-clip-color,Fail |