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

Juan A. Suarez Romero jasuarez at igalia.com
Fri Jan 20 08:39:32 UTC 2017


On Thu, 2017-01-19 at 13:23 -0800, Chad Versace wrote:
> On Wed 18 Jan 2017, Juan A. Suarez Romero wrote:
> > 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.
> > 
> > v2: detect earlier we don't have HiZ buffer (Jason)
> > ---
> >  src/mesa/drivers/dri/i965/intel_fbo.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c b/src/mesa/drivers/dri/i965/intel_fbo.c
> > index de0cd6aca2..aceeba3224 100644
> > --- a/src/mesa/drivers/dri/i965/intel_fbo.c
> > +++ b/src/mesa/drivers/dri/i965/intel_fbo.c
> > @@ -976,7 +976,7 @@ bool
> >  intel_renderbuffer_resolve_hiz(struct brw_context *brw,
> >  			       struct intel_renderbuffer *irb)
> >  {
> > -   if (irb->mt)
> > +   if (irb->mt && irb->mt->hiz_buf != NULL)
> >        return intel_miptree_slice_resolve_hiz(brw,
> >                                               irb->mt,
> >                                               irb->mt_level,
> 
> Even this misses all the cases. brw_fast_clear_depth() will still try to
> emit a hiz clear, which leads to a crash.
> 
> The fix needs to go earlier, directly in intel_miptree_make_shareable()
> itself. I had a fix sitting locally in my tree from last week. I'll send
> it now.


Nice. Thank you!

	J.A.



More information about the mesa-dev mailing list