[Mesa-dev] [PATCH 2/4] i965: add intel_renderbuffer_att_set_needs_depth_resolve

Jordan Justen jordan.l.justen at intel.com
Mon Jul 29 16:18:31 PDT 2013


This function is needed to support layered rendering. With
layered rendering, the attachment stores the state of whether
layered rendering is being used.

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 src/mesa/drivers/dri/i965/intel_fbo.c |   15 +++++++++++++++
 src/mesa/drivers/dri/i965/intel_fbo.h |    3 +++
 2 files changed, 18 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c b/src/mesa/drivers/dri/i965/intel_fbo.c
index 1826a29..1a7ccf8 100644
--- a/src/mesa/drivers/dri/i965/intel_fbo.c
+++ b/src/mesa/drivers/dri/i965/intel_fbo.c
@@ -840,6 +840,21 @@ intel_renderbuffer_resolve_hiz(struct brw_context *brw,
    return false;
 }
 
+void
+intel_renderbuffer_att_set_needs_depth_resolve(struct gl_renderbuffer_attachment *att)
+{
+   struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer);
+   if (irb->mt) {
+      if (att->Layered) {
+         intel_miptree_set_all_slices_need_depth_resolve(irb->mt, irb->mt_level);
+      } else {
+         intel_miptree_slice_set_needs_depth_resolve(irb->mt,
+                                                     irb->mt_level,
+                                                     irb->mt_layer);
+      }
+   }
+}
+
 bool
 intel_renderbuffer_resolve_depth(struct brw_context *brw,
 				 struct intel_renderbuffer *irb)
diff --git a/src/mesa/drivers/dri/i965/intel_fbo.h b/src/mesa/drivers/dri/i965/intel_fbo.h
index 2a8a462..05e96aa 100644
--- a/src/mesa/drivers/dri/i965/intel_fbo.h
+++ b/src/mesa/drivers/dri/i965/intel_fbo.h
@@ -164,6 +164,9 @@ intel_renderbuffer_set_needs_hiz_resolve(struct intel_renderbuffer *irb);
 void
 intel_renderbuffer_set_needs_depth_resolve(struct intel_renderbuffer *irb);
 
+void
+intel_renderbuffer_att_set_needs_depth_resolve(struct gl_renderbuffer_attachment *att);
+
 
 /**
  * \brief Perform a HiZ resolve on the renderbuffer.
-- 
1.7.10.4



More information about the mesa-dev mailing list