[Mesa-dev] [PATCH] i965: check if HiZ buffer is available

Juan A. Suarez Romero jasuarez at igalia.com
Tue Jan 17 09:24:34 UTC 2017


Commit 42011be1e disabled HiZ when sharing depth buffer externally,
which free HiZ buffer.

But in emit_depth_packets() we use that buffer, which generates a crash
in
"piglit.spec.egl_khr_gl_image.egl_khr_gl_renderbuffer_image-clear-shared-image
gl_depth_component24" test when running in Skylake.

This commit avoids using HiZ when the buffer was free.
---
 src/mesa/drivers/dri/i965/gen8_depth_state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/gen8_depth_state.c b/src/mesa/drivers/dri/i965/gen8_depth_state.c
index 14689f400f..5a4af0661f 100644
--- a/src/mesa/drivers/dri/i965/gen8_depth_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_depth_state.c
@@ -441,7 +441,7 @@ gen8_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
                       BRW_SURFACE_2D,
                       true, /* depth writes */
                       NULL, false, /* no stencil for now */
-                      true, /* hiz */
+                      mt->hiz_buf != NULL, /* hiz */
                       surface_width,
                       surface_height,
                       mt->logical_depth0,
-- 
2.11.0



More information about the mesa-dev mailing list