[Mesa-dev] [PATCH 35/41] intel: Enable HiZ for texture renderbuffers

Chad Versace chad.versace at linux.intel.com
Thu Nov 17 19:59:02 PST 2011


When a depth texture is first attached to framebuffer, allocate a HiZ
miptree for it.

Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 src/mesa/drivers/dri/intel/intel_fbo.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 0b6b227..1842925 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -1040,6 +1040,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;
-- 
1.7.7.1



More information about the mesa-dev mailing list