Mesa (master): iris: Use converted depth in clear_depth_stencil

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 13 19:01:49 UTC 2020


Module: Mesa
Branch: master
Commit: 0fe2d49ccddf9b35c259a5466b729c6237a0e378
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0fe2d49ccddf9b35c259a5466b729c6237a0e378

Author: Nanley Chery <nanley.g.chery at intel.com>
Date:   Wed Oct 14 10:45:57 2020 -0700

iris: Use converted depth in clear_depth_stencil

Until recently, the depth value from glClearBufferfv wasn't clamped.

Before then, this patch enabled the driver to fail the clearbuffer-depth
piglit test with INTEL_DEBUG=nofc. This is because convert_depth_value
relies on the assumption that the depth value is clamped.

Reviewed-by: Eric Anholt <eric at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7410>

---

 src/gallium/drivers/iris/iris_clear.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_clear.c b/src/gallium/drivers/iris/iris_clear.c
index dbb808de75e..eaffcb87fe6 100644
--- a/src/gallium/drivers/iris/iris_clear.c
+++ b/src/gallium/drivers/iris/iris_clear.c
@@ -464,11 +464,8 @@ fast_clear_depth(struct iris_context *ice,
                  const struct pipe_box *box,
                  float depth)
 {
-   struct pipe_resource *p_res = (void *) res;
    struct iris_batch *batch = &ice->batches[IRIS_BATCH_RENDER];
 
-   depth = convert_depth_value(p_res->format, depth);
-
    bool update_clear_depth = false;
 
    /* If we're clearing to a new clear value, then we need to resolve any clear
@@ -690,7 +687,7 @@ iris_clear(struct pipe_context *ctx,
       clear_depth_stencil(ice, psurf->texture, psurf->u.tex.level, &box, true,
                           buffers & PIPE_CLEAR_DEPTH,
                           buffers & PIPE_CLEAR_STENCIL,
-                          depth, stencil);
+                          convert_depth_value(psurf->format, depth), stencil);
    }
 
    if (buffers & PIPE_CLEAR_COLOR) {
@@ -837,7 +834,7 @@ iris_clear_depth_stencil(struct pipe_context *ctx,
    clear_depth_stencil(ice, psurf->texture, psurf->u.tex.level, &box,
                        render_condition_enabled,
                        flags & PIPE_CLEAR_DEPTH, flags & PIPE_CLEAR_STENCIL,
-                       depth, stencil);
+                       convert_depth_value(psurf->format, depth), stencil);
 }
 
 void



More information about the mesa-commit mailing list