[Mesa-dev] [PATCH 17/19] i965: After emitting a HiZ buffer, mark that it needs a HiZ resolve

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


Signed-off-by: Chad Versace <chad at chad-versace.us>
---
 src/mesa/drivers/dri/i965/brw_misc_state.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c
index 5adf2d7..1121f61 100644
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
@@ -377,6 +377,8 @@ static void emit_depthbuffer(struct brw_context *brw)
       /* Emit hiz buffer. */
       if (has_hiz) {
 	 struct intel_hiz_control *hiz = &depth_irb->region->hiz;
+	 assert(hiz->need_resolve != INTEL_HIZ_NEED_HIZ_RESOLVE);
+
 	 BEGIN_BATCH(3);
 	 OUT_BATCH((_3DSTATE_HIER_DEPTH_BUFFER << 16) | (3 - 2));
 	 OUT_BATCH(hiz->region->pitch * hiz->region->cpp - 1);
@@ -384,6 +386,10 @@ static void emit_depthbuffer(struct brw_context *brw)
 		   I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
 		   0);
 	 ADVANCE_BATCH();
+
+	 if (!brw->hiz.op) {
+	    hiz->need_resolve = INTEL_HIZ_NEED_DEPTH_RESOLVE;
+	 }
       } else {
 	 BEGIN_BATCH(3);
 	 OUT_BATCH((_3DSTATE_HIER_DEPTH_BUFFER << 16) | (3 - 2));
-- 
1.7.6.2



More information about the mesa-dev mailing list