vbo: print first element of the VAO when the binding stride is 0
authorAndres Gomez <agomez@igalia.com>
Sun, 28 Jan 2018 23:35:15 +0000 (01:35 +0200)
committerAndres Gomez <agomez@igalia.com>
Tue, 6 Feb 2018 13:30:12 +0000 (15:30 +0200)
Cc: Mathias Fröhlich <mathias.froehlich@web.de>
Cc: Brian Paul <brianp@vmware.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
src/mesa/vbo/vbo_exec_array.c

index 42759d5897882d8a6aa94c3bc081f2472dccbeeb..608ddaac47af0ad8ccc05a1a4f5bc97ce5e3cb1f 100644 (file)
@@ -286,14 +286,15 @@ print_draw_arrays(struct gl_context *ctx,
             _mesa_vertex_attrib_address(array, binding);
          float *f = (float *) (p + offset);
          int *k = (int *) f;
-         int i;
+        int i = 0;
          int n = (count * binding->Stride) / 4;
          if (n > 32)
             n = 32;
          printf("  Data at offset %d:\n", offset);
-         for (i = 0; i < n; i++) {
+        do {
             printf("    float[%d] = 0x%08x %f\n", i, k[i], f[i]);
-         }
+           i++;
+        } while (i < n);
          ctx->Driver.UnmapBuffer(ctx, bufObj, MAP_INTERNAL);
       }
    }