[Mesa-dev] [PATCH 1/5] intel: Add HiZ control state to intel_region
Chad Versace
chad at chad-versace.us
Mon Oct 17 07:40:24 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 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 | 1 +
src/mesa/drivers/dri/intel/intel_regions.h | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c
index 67142a1..85f8994 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.c
+++ b/src/mesa/drivers/dri/intel/intel_regions.c
@@ -309,6 +309,7 @@ intel_region_release(struct intel_region **region_handle)
assert(region->map_refcount == 0);
drm_intel_bo_unreference(region->bo);
+ intel_region_release(®ion->hiz.region);
if (region->name > 0)
_mesa_HashRemove(region->screen->named_regions, region->name);
diff --git a/src/mesa/drivers/dri/intel/intel_regions.h b/src/mesa/drivers/dri/intel/intel_regions.h
index e639895..cd48977 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.4
More information about the mesa-dev
mailing list