Mesa (master): i965: Move CLIP VP state dump to using the state_batch_list[ ].

Eric Anholt anholt at kemper.freedesktop.org
Mon Jul 11 16:27:35 UTC 2011


Module: Mesa
Branch: master
Commit: 2a8d744345da718ed98b7ee216c4091018830900
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2a8d744345da718ed98b7ee216c4091018830900

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Jun 22 15:56:07 2011 -0700

i965: Move CLIP VP state dump to using the state_batch_list[].

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_state_dump.c |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_state_dump.c b/src/mesa/drivers/dri/i965/brw_state_dump.c
index 7a3a88f..1b76a30 100644
--- a/src/mesa/drivers/dri/i965/brw_state_dump.c
+++ b/src/mesa/drivers/dri/i965/brw_state_dump.c
@@ -319,7 +319,8 @@ static void dump_sf_viewport_state(struct brw_context *brw)
    drm_intel_bo_unmap(intel->batch.bo);
 }
 
-static void dump_clip_viewport_state(struct brw_context *brw)
+static void dump_clip_viewport_state(struct brw_context *brw,
+				     uint32_t offset)
 {
    struct intel_context *intel = &brw->intel;
    const char *name = "CLIP VP";
@@ -330,8 +331,8 @@ static void dump_clip_viewport_state(struct brw_context *brw)
 
    drm_intel_bo_map(intel->batch.bo, GL_FALSE);
 
-   vp = intel->batch.bo->virtual + brw->clip.vp_offset;
-   vp_off = intel->batch.bo->offset + brw->clip.vp_offset;
+   vp = intel->batch.bo->virtual + offset;
+   vp_off = intel->batch.bo->offset + offset;
 
    state_out(name, vp, vp_off, 0, "xmin = %f\n", vp->xmin);
    state_out(name, vp, vp_off, 1, "xmax = %f\n", vp->xmax);
@@ -486,6 +487,21 @@ static void brw_debug_prog(struct brw_context *brw,
    drm_intel_bo_unmap(brw->cache.bo);
 }
 
+static void
+dump_state_batch(struct brw_context *brw)
+{
+   int i;
+
+   for (i = 0; i < brw->state_batch_count; i++) {
+      switch (brw->state_batch_list[i].type) {
+      case AUB_TRACE_CLIP_VP_STATE:
+	 dump_clip_viewport_state(brw, brw->state_batch_list[i].offset);
+	 break;
+      default:
+	 break;
+      }
+   }
+}
 
 /**
  * Print additional debug information associated with the batchbuffer
@@ -534,8 +550,6 @@ void brw_debug_batch(struct intel_context *intel)
       dump_sf_clip_viewport_state(brw);
    else
       dump_sf_viewport_state(brw);
-   if (intel->gen == 6)
-      dump_clip_viewport_state(brw);
 
    if (intel->gen < 6)
        state_struct_out("WM", intel->batch.bo, brw->wm.state_offset,
@@ -548,4 +562,6 @@ void brw_debug_batch(struct intel_context *intel)
 	dump_cc_state(brw);
 	dump_blend_state(brw);
    }
+
+   dump_state_batch(brw);
 }




More information about the mesa-commit mailing list