Mesa (master): iris: Fix fast-clearing of depth via glClearTex(Sub)Image

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 7 11:15:48 UTC 2020


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

Author: Danylo Piliaiev <danylo.piliaiev at globallogic.com>
Date:   Thu Jul  2 11:39:25 2020 +0300

iris: Fix fast-clearing of depth via glClearTex(Sub)Image

If we clear depth only texture via glClearTex(Sub)Image it may cause:
../src/intel/blorp/blorp_genX_exec.h:1554: blorp_emit_surface_states: Assertion `params->depth.enabled || params->stencil.enabled' failed.

due to clear_depth_stencil calling blorp_clear_depth_stencil when
depth is already fast-cleared and there is no stencil.

Fixes piglit test: arb_clear_texture-depth

Fixes: 51638cf18a532510f9e1fd8f36207b56d38137b8
Signed-off-by: Danylo Piliaiev <danylo.piliaiev at globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5770>

---

 src/gallium/drivers/iris/iris_clear.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/iris/iris_clear.c b/src/gallium/drivers/iris/iris_clear.c
index 50936412b2d..2a78155f4e7 100644
--- a/src/gallium/drivers/iris/iris_clear.c
+++ b/src/gallium/drivers/iris/iris_clear.c
@@ -583,7 +583,7 @@ clear_depth_stencil(struct iris_context *ice,
    /* At this point, we might have fast cleared the depth buffer. So if there's
     * no stencil clear pending, return early.
     */
-   if (!(clear_depth || clear_stencil)) {
+   if (!(clear_depth || (clear_stencil && stencil_res))) {
       return;
    }
 



More information about the mesa-commit mailing list