From 7baedc9162754334977f4f4eaa0f8edef1b99826 Mon Sep 17 00:00:00 2001 From: Jan Zielinski Date: Tue, 29 Oct 2019 19:29:27 +0100 Subject: [PATCH] gallium/swr: Fix depth values for blit scenario Reviewed-by: Bruce Cherniak --- src/gallium/drivers/swr/swr_state.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp index c6b19204b32..94507b2f2d9 100644 --- a/src/gallium/drivers/swr/swr_state.cpp +++ b/src/gallium/drivers/swr/swr_state.cpp @@ -1231,6 +1231,14 @@ swr_update_derived(struct pipe_context *pipe, util_viewport_zmin_zmax(state, rasterizer->clip_halfz, &vp->minZ, &vp->maxZ); + if (rasterizer->depth_clip_near) { + vp->minZ = 0.0f; + } + + if (rasterizer->depth_clip_far) { + vp->maxZ = 1.0f; + } + vpm->m00[i] = state->scale[0]; vpm->m11[i] = state->scale[1]; vpm->m22[i] = state->scale[2]; -- 2.30.2