[Mesa-dev] [PATCH 03/12] intel: Add accessor functions for intel_miptree_slice::has_hiz

Chad Versace chad.versace at linux.intel.com
Thu Feb 28 15:45:07 PST 2013


Add two new functions:
  intel_miptree_slice_has_hiz
  intel_renderbuffer_has_hiz

These functions are not yet used.

Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 src/mesa/drivers/dri/intel/intel_fbo.c         | 7 +++++++
 src/mesa/drivers/dri/intel/intel_fbo.h         | 3 +++
 src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 9 +++++++++
 src/mesa/drivers/dri/intel/intel_mipmap_tree.h | 5 +++++
 4 files changed, 24 insertions(+)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 9a9bb9f..72b03c9 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -925,6 +925,13 @@ intel_renderbuffer_set_needs_downsample(struct intel_renderbuffer *irb)
       irb->mt->need_downsample = true;
 }
 
+bool
+intel_renderbuffer_has_hiz(struct intel_renderbuffer *irb)
+{
+   return irb->mt &&
+          intel_miptree_slice_has_hiz(irb->mt, irb->mt_level, irb->mt_layer);
+}
+
 void
 intel_renderbuffer_set_needs_hiz_resolve(struct intel_renderbuffer *irb)
 {
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h
index ce744bf..27638c0 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.h
+++ b/src/mesa/drivers/dri/intel/intel_fbo.h
@@ -166,6 +166,9 @@ intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex);
 void
 intel_renderbuffer_set_needs_downsample(struct intel_renderbuffer *irb);
 
+bool
+intel_renderbuffer_has_hiz(struct intel_renderbuffer *irb);
+
 void
 intel_renderbuffer_set_needs_hiz_resolve(struct intel_renderbuffer *irb);
 
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 11726ac..ee7e94a 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -903,6 +903,15 @@ intel_miptree_alloc_hiz(struct intel_context *intel,
    return true;
 }
 
+bool
+intel_miptree_slice_has_hiz(struct intel_mipmap_tree *mt,
+                            uint32_t level,
+                            uint32_t layer)
+{
+   intel_miptree_check_level_layer(mt, level, layer);
+   return mt->level[level].slice[layer].has_hiz;
+}
+
 void
 intel_miptree_slice_set_needs_hiz_resolve(struct intel_mipmap_tree *mt,
 					  uint32_t level,
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
index ed2ecc4..bc55e26 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
@@ -533,6 +533,11 @@ intel_miptree_alloc_hiz(struct intel_context *intel,
 			struct intel_mipmap_tree *mt,
                         GLuint num_samples);
 
+bool
+intel_miptree_slice_has_hiz(struct intel_mipmap_tree *mt,
+                            uint32_t level,
+                            uint32_t layer);
+
 void
 intel_miptree_slice_set_needs_hiz_resolve(struct intel_mipmap_tree *mt,
                                           uint32_t level,
-- 
1.8.1.2



More information about the mesa-dev mailing list