intel: Enable HiZ for texture renderbuffers
authorChad Versace <chad.versace@linux.intel.com>
Wed, 16 Nov 2011 06:51:35 +0000 (22:51 -0800)
committerChad Versace <chad.versace@linux.intel.com>
Tue, 22 Nov 2011 18:50:51 +0000 (10:50 -0800)
When a depth texture is first attached to framebuffer, allocate a HiZ
miptree for it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/intel/intel_fbo.c

index 4930999cdb2a1f0cff1aea6d773f4a3ddf9c8aa6..c96430d41bd4bf50112928f81f76c05151a71fac 100644 (file)
@@ -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;