[Mesa-dev] [PATCH 05/19] intel: Add HiZ control state to intel_region

Chad Versace chad at chad-versace.us
Fri Sep 23 17:37:35 PDT 2011


The HiZ control state is used only by depth regions for which HiZ is
enabled. The control state points to the depth region's associated HiZ
region and indicates if any resolve is needed.

A later commit will remove intel_renderbuffer::hiz_region. since that
pointer is will be duplicated by intel_renderbuffer::region::hiz::region.

Signed-off-by: Chad Versace <chad at chad-versace.us>
---
 src/mesa/drivers/dri/intel/intel_regions.c |    2 ++
 src/mesa/drivers/dri/intel/intel_regions.h |   21 +++++++++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c
index 4d4ddd9..cd0542c 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.c
+++ b/src/mesa/drivers/dri/intel/intel_regions.c
@@ -292,6 +292,8 @@ intel_region_release(struct intel_region **region_handle)
    if (region->refcount == 0) {
       assert(region->map_refcount == 0);
 
+      intel_region_release(&region->hiz.region);
+
       drm_intel_bo_unreference(region->buffer);
 
       if (region->name > 0)
diff --git a/src/mesa/drivers/dri/intel/intel_regions.h b/src/mesa/drivers/dri/intel/intel_regions.h
index f3f6a07..3b7a3cf 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.h
+++ b/src/mesa/drivers/dri/intel/intel_regions.h
@@ -66,6 +66,27 @@ struct intel_region
 
    uint32_t name; /**< Global name for the bo */
    struct intel_screen *screen;
+
+   /**
+    * \brief HiZ control state
+    *
+    * Used only by depth buffers that possess a HiZ buffer.
+    */
+   struct intel_hiz_control {
+      struct intel_region *region; /**< of HiZ buffer. */
+      gl_format depth_format; /**< depth_rb->Format */
+
+      enum intel_hiz_need_resolve {
+         /** No resolve is needed. */
+         INTEL_HIZ_NEED_NO_RESOLVE = 0,
+
+         /** Content of the HiZ buffer is stale. A HiZ resolve is needed. */
+         INTEL_HIZ_NEED_HIZ_RESOLVE,
+
+         /** Content of the depth buffer is stale. A depth resolve is needed. */
+         INTEL_HIZ_NEED_DEPTH_RESOLVE,
+      } need_resolve;
+   } hiz;
 };
 
 
-- 
1.7.6.2



More information about the mesa-dev mailing list