summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorAndres Gomez <[email protected]>2018-01-29 01:35:17 +0200
committerAndres Gomez <[email protected]>2018-02-06 15:30:29 +0200
commit1ec88755c2d4498e5a5a515593855611a2505e7b (patch)
treee1eea13019fc00a872d0896830fec2f182d0524f /src/mesa
parent0057ae40380d97598bc01c3a863525d7e9eafbe9 (diff)
vbo: provide 64bits support to print_draw_arrays
Cc: Mathias Fröhlich <[email protected]> Cc: Brian Paul <[email protected]> Signed-off-by: Andres Gomez <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/vbo/vbo_exec_array.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index 74b9a1b0ebd..b30e044a879 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -284,15 +284,32 @@ print_draw_arrays(struct gl_context *ctx,
MAP_INTERNAL);
int offset = (int) (GLintptr)
_mesa_vertex_attrib_address(array, binding);
+
+ unsigned multiplier;
+ switch (array->Type) {
+ case GL_DOUBLE:
+ case GL_INT64_ARB:
+ case GL_UNSIGNED_INT64_ARB:
+ multiplier = 2;
+ break;
+ default:
+ multiplier = 1;
+ }
+
float *f = (float *) (p + offset);
int *k = (int *) f;
int i = 0;
- int n = (count - 1) * (binding->Stride / 4) + array->Size;
+ int n = (count - 1) * (binding->Stride / (4 * multiplier))
+ + array->Size;
if (n > 32)
n = 32;
printf(" Data at offset %d:\n", offset);
do {
- printf(" float[%d] = 0x%08x %f\n", i, k[i], f[i]);
+ if (multiplier == 2)
+ printf(" double[%d] = 0x%016llx %lf\n", i,
+ ((unsigned long long *) k)[i], ((double *) f)[i]);
+ else
+ printf(" float[%d] = 0x%08x %f\n", i, k[i], f[i]);
i++;
} while (i < n);
ctx->Driver.UnmapBuffer(ctx, bufObj, MAP_INTERNAL);