i965: Stop dumping programs after the first all-zeroes entry.
authorEric Anholt <eric@anholt.net>
Fri, 6 Mar 2009 02:17:13 +0000 (18:17 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 6 Mar 2009 03:42:18 +0000 (19:42 -0800)
src/mesa/drivers/dri/i965/brw_state_dump.c

index b28c57c2bcf759babf844024f5b3124f92d8e691..5d332d010c2fb3f3df752f32b9cbcef7674f3797 100644 (file)
@@ -162,6 +162,14 @@ static void brw_debug_prog(const char *name, dri_bo *prog)
       fprintf(stderr, "%8s: 0x%08x: 0x%08x 0x%08x 0x%08x 0x%08x\n",
              name, (unsigned int)prog->offset + i * 4 * 4,
              data[i * 4], data[i * 4 + 1], data[i * 4 + 2], data[i * 4 + 3]);
+      /* Stop at the end of the program.  It'd be nice to keep track of the actual
+       * intended program size instead of guessing like this.
+       */
+      if (data[i * 4 + 0] == 0 &&
+         data[i * 4 + 1] == 0 &&
+         data[i * 4 + 2] == 0 &&
+         data[i * 4 + 3] == 0)
+        break;
    }
 
    dri_bo_unmap(prog);