From: Chad Versace Date: Wed, 16 Nov 2011 06:51:35 +0000 (-0800) Subject: intel: Enable HiZ for texture renderbuffers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=293e9a7ccfeb64efd54464658518e4ded054a13c;p=mesa.git intel: Enable HiZ for texture renderbuffers When a depth texture is first attached to framebuffer, allocate a HiZ miptree for it. Reviewed-by: Eric Anholt Signed-off-by: Chad Versace --- diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 4930999cdb2..c96430d41bd 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -1047,6 +1047,13 @@ intel_renderbuffer_update_wrapper(struct intel_context *intel, } else { intel_miptree_reference(&irb->mt, mt); intel_renderbuffer_set_draw_offset(irb); + + if (mt->hiz_mt == NULL && + intel->vtbl.is_hiz_depth_format(intel, rb->Format)) { + intel_miptree_alloc_hiz(intel, mt); + if (!mt->hiz_mt) + return false; + } } return true;