From 293e9a7ccfeb64efd54464658518e4ded054a13c Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Tue, 15 Nov 2011 22:51:35 -0800 Subject: [PATCH] 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 --- src/mesa/drivers/dri/intel/intel_fbo.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; -- 2.30.2