summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-06-22 15:58:50 -0700
committerEric Anholt <[email protected]>2011-07-11 09:27:26 -0700
commitfbfeff73f3d6195e62ee413c18a93632edc3510d (patch)
tree537ee21847498ce8f8bcbf6af088571a95ccab5c
parent2a8d744345da718ed98b7ee216c4091018830900 (diff)
i965: Move the SF VP state dump to using the state_batch_list[]
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_dump.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_state_dump.c b/src/mesa/drivers/dri/i965/brw_state_dump.c
index 1b76a301b93..2736ad5aa42 100644
--- a/src/mesa/drivers/dri/i965/brw_state_dump.c
+++ b/src/mesa/drivers/dri/i965/brw_state_dump.c
@@ -290,7 +290,8 @@ static void dump_gen7_sampler_state(struct brw_context *brw)
}
-static void dump_sf_viewport_state(struct brw_context *brw)
+static void dump_sf_viewport_state(struct brw_context *brw,
+ uint32_t offset)
{
struct intel_context *intel = &brw->intel;
const char *name = "SF VP";
@@ -301,8 +302,8 @@ static void dump_sf_viewport_state(struct brw_context *brw)
drm_intel_bo_map(intel->batch.bo, GL_FALSE);
- vp = intel->batch.bo->virtual + brw->sf.vp_offset;
- vp_off = intel->batch.bo->offset + brw->sf.vp_offset;
+ vp = intel->batch.bo->virtual + offset;
+ vp_off = intel->batch.bo->offset + offset;
state_out(name, vp, vp_off, 0, "m00 = %f\n", vp->viewport.m00);
state_out(name, vp, vp_off, 1, "m11 = %f\n", vp->viewport.m11);
@@ -341,7 +342,8 @@ static void dump_clip_viewport_state(struct brw_context *brw,
drm_intel_bo_unmap(intel->batch.bo);
}
-static void dump_sf_clip_viewport_state(struct brw_context *brw)
+static void dump_sf_clip_viewport_state(struct brw_context *brw,
+ uint32_t offset)
{
struct intel_context *intel = &brw->intel;
const char *name = "SF_CLIP VP";
@@ -352,8 +354,8 @@ static void dump_sf_clip_viewport_state(struct brw_context *brw)
drm_intel_bo_map(intel->batch.bo, GL_FALSE);
- vp = intel->batch.bo->virtual + brw->sf.vp_offset;
- vp_off = intel->batch.bo->offset + brw->sf.vp_offset;
+ vp = intel->batch.bo->virtual + offset;
+ vp_off = intel->batch.bo->offset + offset;
state_out(name, vp, vp_off, 0, "m00 = %f\n", vp->viewport.m00);
state_out(name, vp, vp_off, 1, "m11 = %f\n", vp->viewport.m11);
@@ -490,12 +492,22 @@ static void brw_debug_prog(struct brw_context *brw,
static void
dump_state_batch(struct brw_context *brw)
{
+ struct intel_context *intel = &brw->intel;
int i;
for (i = 0; i < brw->state_batch_count; i++) {
+ uint32_t offset = brw->state_batch_list[i].offset;
+
switch (brw->state_batch_list[i].type) {
case AUB_TRACE_CLIP_VP_STATE:
- dump_clip_viewport_state(brw, brw->state_batch_list[i].offset);
+ dump_clip_viewport_state(brw, offset);
+ break;
+ case AUB_TRACE_SF_VP_STATE:
+ if (intel->gen >= 7) {
+ dump_sf_clip_viewport_state(brw, offset);
+ } else {
+ dump_sf_viewport_state(brw, offset);
+ }
break;
default:
break;
@@ -546,10 +558,6 @@ void brw_debug_batch(struct intel_context *intel)
sizeof(struct brw_sf_unit_state));
brw_debug_prog(brw, "SF prog", brw->sf.prog_offset);
}
- if (intel->gen >= 7)
- dump_sf_clip_viewport_state(brw);
- else
- dump_sf_viewport_state(brw);
if (intel->gen < 6)
state_struct_out("WM", intel->batch.bo, brw->wm.state_offset,