[Mesa-dev] [PATCH 23/41] intel: Add resolve functions for renderbuffers

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


Add the following functions:
   intel_renderbuffer_resolve_hiz
   intel_renderbuffer_resolve_depth

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

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 65b42ec..5b2a7ac 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -1422,6 +1422,69 @@ intel_blit_framebuffer(struct gl_context *ctx,
                               mask, filter);
 }
 
+void
+intel_renderbuffer_set_needs_hiz_resolve(struct intel_renderbuffer *irb)
+{
+   if (irb->mt) {
+      intel_miptree_slice_set_needs_hiz_resolve(irb->mt,
+                                                irb->mt_level,
+                                                irb->mt_layer);
+   } else if (irb->wrapped_depth) {
+      intel_renderbuffer_set_needs_hiz_resolve(
+	    intel_renderbuffer(irb->wrapped_depth));
+   } else {
+      return;
+   }
+}
+
+void
+intel_renderbuffer_set_needs_depth_resolve(struct intel_renderbuffer *irb)
+{
+   if (irb->mt) {
+      intel_miptree_slice_set_needs_depth_resolve(irb->mt,
+                                                  irb->mt_level,
+                                                  irb->mt_layer);
+   } else if (irb->wrapped_depth) {
+      intel_renderbuffer_set_needs_depth_resolve(
+	    intel_renderbuffer(irb->wrapped_depth));
+   } else {
+      return;
+   }
+}
+
+bool
+intel_renderbuffer_resolve_hiz(struct intel_context *intel,
+			       struct intel_renderbuffer *irb)
+{
+   if (irb->mt)
+      return intel_miptree_slice_resolve_hiz(intel,
+                                             irb->mt,
+                                             irb->mt_level,
+                                             irb->mt_layer);
+   if (irb->wrapped_depth)
+      return intel_renderbuffer_resolve_hiz(intel,
+					    intel_renderbuffer(irb->wrapped_depth));
+
+   return false;
+}
+
+bool
+intel_renderbuffer_resolve_depth(struct intel_context *intel,
+				 struct intel_renderbuffer *irb)
+{
+   if (irb->mt)
+      return intel_miptree_slice_resolve_depth(intel,
+                                               irb->mt,
+                                               irb->mt_level,
+                                               irb->mt_layer);
+
+   if (irb->wrapped_depth)
+      return intel_renderbuffer_resolve_depth(intel,
+                                              intel_renderbuffer(irb->wrapped_depth));
+
+   return false;
+}
+
 /**
  * Do one-time context initializations related to GL_EXT_framebuffer_object.
  * Hook in device driver functions.
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h
index 6da370d..bb94309 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.h
+++ b/src/mesa/drivers/dri/intel/intel_fbo.h
@@ -185,4 +185,35 @@ intel_renderbuffer_tile_offsets(struct intel_renderbuffer *irb,
 struct intel_region*
 intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex);
 
+void
+intel_renderbuffer_set_needs_hiz_resolve(struct intel_renderbuffer *irb);
+
+void
+intel_renderbuffer_set_needs_depth_resolve(struct intel_renderbuffer *irb);
+
+
+/**
+ * \brief Perform a HiZ resolve on the renderbuffer.
+ *
+ * It is safe to call this function on a renderbuffer without HiZ. In that
+ * case, the function is a no-op.
+ *
+ * \return false if no resolve was needed
+ */
+bool
+intel_renderbuffer_resolve_hiz(struct intel_context *intel,
+			       struct intel_renderbuffer *irb);
+
+/**
+ * \brief Perform a depth resolve on the renderbuffer.
+ *
+ * It is safe to call this function on a renderbuffer without HiZ. In that
+ * case, the function is a no-op.
+ *
+ * \return false if no resolve was needed
+ */
+bool
+intel_renderbuffer_resolve_depth(struct intel_context *intel,
+				 struct intel_renderbuffer *irb);
+
 #endif /* INTEL_FBO_H */
-- 
1.7.7.1



More information about the mesa-dev mailing list