summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo
diff options
context:
space:
mode:
authorMathias Fröhlich <mathias.froehlich@web.de>2016-06-17 08:09:05 +0200
committerMathias Fröhlich <mathias.froehlich@web.de>2016-07-31 10:05:45 +0200
commit99b42184f998803c57beb3eec085bdb7f388ec22 (patch)
tree939b657c82d05e667089d97547bf3da39d558cf7 /src/mesa/vbo
parenteec516d8e16eecbe290a6a3cc7afa628760cefb3 (diff)
downloadexternal_mesa3d-99b42184f998803c57beb3eec085bdb7f388ec22.zip
external_mesa3d-99b42184f998803c57beb3eec085bdb7f388ec22.tar.gz
external_mesa3d-99b42184f998803c57beb3eec085bdb7f388ec22.tar.bz2
vbo: Walk the VAO in print_draw_arrays.
Only a debugging function, but move away from gl_client_array and use the first order information from the VAO. Also make use of gl_vert_attrib_name. Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r--src/mesa/vbo/vbo_exec_array.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index 2d5b0dc..48182ab 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -230,37 +230,37 @@ static void
print_draw_arrays(struct gl_context *ctx,
GLenum mode, GLint start, GLsizei count)
{
- struct vbo_context *vbo = vbo_context(ctx);
- struct vbo_exec_context *exec = &vbo->exec;
- struct gl_vertex_array_object *vao = ctx->Array.VAO;
- int i;
+ const struct gl_vertex_array_object *vao = ctx->Array.VAO;
printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n",
mode, start, count);
- for (i = 0; i < 32; i++) {
- struct gl_buffer_object *bufObj = exec->array.inputs[i]->BufferObj;
- GLuint bufName = bufObj->Name;
- GLint stride = exec->array.inputs[i]->Stride;
- printf("attr %2d: size %d stride %d enabled %d "
+ unsigned i;
+ for (i = 0; i < VERT_ATTRIB_MAX; ++i) {
+ const struct gl_vertex_attrib_array *array = &vao->VertexAttrib[i];
+ if (!array->Enabled)
+ continue;
+
+ const struct gl_vertex_buffer_binding *binding =
+ &vao->VertexBinding[array->VertexBinding];
+ struct gl_buffer_object *bufObj = binding->BufferObj;
+
+ printf("attr %s: size %d stride %d enabled %d "
"ptr %p Bufobj %u\n",
- i,
- exec->array.inputs[i]->Size,
- stride,
- /*exec->array.inputs[i]->Enabled,*/
- vao->_VertexAttrib[VERT_ATTRIB_FF(i)].Enabled,
- exec->array.inputs[i]->Ptr,
- bufName);
-
- if (bufName) {
+ gl_vert_attrib_name((gl_vert_attrib)i),
+ array->Size, binding->Stride, array->Enabled,
+ array->Ptr, bufObj->Name);
+
+ if (_mesa_is_bufferobj(bufObj)) {
GLubyte *p = ctx->Driver.MapBufferRange(ctx, 0, bufObj->Size,
GL_MAP_READ_BIT, bufObj,
MAP_INTERNAL);
- int offset = (int) (GLintptr) exec->array.inputs[i]->Ptr;
+ int offset = (int) (GLintptr)
+ _mesa_vertex_attrib_address(array, binding);
float *f = (float *) (p + offset);
int *k = (int *) f;
int i;
- int n = (count * stride) / 4;
+ int n = (count * binding->Stride) / 4;
if (n > 32)
n = 32;
printf(" Data at offset %d:\n", offset);