i965: Add dumping for gen6 WM constants too.
authorEric Anholt <eric@anholt.net>
Tue, 26 Jul 2011 01:15:25 +0000 (18:15 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 5 Aug 2011 17:08:31 +0000 (10:08 -0700)
This looks just like the VS dump for now.

src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_state_dump.c
src/mesa/drivers/dri/i965/gen6_wm_state.c

index 471015cf9d0f2c8dca7e4b5aaabea1be23f0e403..22baf978ad47654c5723c6e20e857f8923b2f557 100644 (file)
@@ -212,6 +212,7 @@ enum state_struct_type {
    AUB_TRACE_BINDING_TABLE =           0x101,
    AUB_TRACE_SURFACE_STATE =           0x102,
    AUB_TRACE_VS_CONSTANTS =            0x103,
+   AUB_TRACE_WM_CONSTANTS =            0x104,
 };
 
 /** Subclass of Mesa vertex program */
index b9e5cc1a534f1b2833682feecd0b0014065986b8..cb7a3ef73d3bca74c9c1c7ed6e37518ea6f9cd57 100644 (file)
@@ -455,6 +455,23 @@ dump_vs_constants(struct brw_context *brw, uint32_t offset, uint32_t size)
    }
 }
 
+static void
+dump_wm_constants(struct brw_context *brw, uint32_t offset, uint32_t size)
+{
+   const char *name = "WM_CONST";
+   struct intel_context *intel = &brw->intel;
+   uint32_t *as_uint = intel->batch.bo->virtual + offset;
+   float *as_float = intel->batch.bo->virtual + offset;
+   int i;
+
+   for (i = 0; i < size / 4; i += 4) {
+      batch_out(brw, name, offset, i, "%3d: (% f % f % f % f) (0x%08x 0x%08x 0x%08x 0x%08x)\n",
+               i / 4,
+               as_float[i], as_float[i + 1], as_float[i + 2], as_float[i + 3],
+               as_uint[i], as_uint[i + 1], as_uint[i + 2], as_uint[i + 3]);
+   }
+}
+
 static void dump_binding_table(struct brw_context *brw, uint32_t offset,
                               uint32_t size)
 {
@@ -602,6 +619,9 @@ dump_state_batch(struct brw_context *brw)
       case AUB_TRACE_VS_CONSTANTS:
         dump_vs_constants(brw, offset, size);
         break;
+      case AUB_TRACE_WM_CONSTANTS:
+        dump_wm_constants(brw, offset, size);
+        break;
       default:
         break;
       }
index 185da9c355faf7143c6e0837b75e1942deb810d6..3d525248f258346eaf5f28c3f7d7f607766281eb 100644 (file)
@@ -54,7 +54,7 @@ gen6_prepare_wm_push_constants(struct brw_context *brw)
       float *constants;
       unsigned int i;
 
-      constants = brw_state_batch(brw, AUB_TRACE_NO_TYPE,
+      constants = brw_state_batch(brw, AUB_TRACE_WM_CONSTANTS,
                                  brw->wm.prog_data->nr_params *
                                  sizeof(float),
                                  32, &brw->wm.push_const_offset);