aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/vbo/vbo_exec_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/vbo/vbo_exec_api.c')
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec_api.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/mesalib/src/mesa/vbo/vbo_exec_api.c b/mesalib/src/mesa/vbo/vbo_exec_api.c
index 62e7d03f3..70551e0e1 100644
--- a/mesalib/src/mesa/vbo/vbo_exec_api.c
+++ b/mesalib/src/mesa/vbo/vbo_exec_api.c
@@ -1091,15 +1091,23 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec )
struct gl_client_array *arrays = exec->vtx.arrays;
unsigned i;
- memcpy(arrays, vbo->legacy_currval, 16 * sizeof(arrays[0]));
- memcpy(arrays + 16, vbo->generic_currval, 16 * sizeof(arrays[0]));
-
- for (i = 0; i < 16; ++i) {
- arrays[i ].BufferObj = NULL;
- arrays[i + 16].BufferObj = NULL;
- _mesa_reference_buffer_object(ctx, &arrays[i ].BufferObj,
+ memcpy(arrays, vbo->legacy_currval,
+ VERT_ATTRIB_FF_MAX * sizeof(arrays[0]));
+ for (i = 0; i < VERT_ATTRIB_FF_MAX; ++i) {
+ struct gl_client_array *array;
+ array = &arrays[VERT_ATTRIB_FF(i)];
+ array->BufferObj = NULL;
+ _mesa_reference_buffer_object(ctx, &arrays->BufferObj,
vbo->legacy_currval[i].BufferObj);
- _mesa_reference_buffer_object(ctx, &arrays[i + 16].BufferObj,
+ }
+
+ memcpy(arrays + VERT_ATTRIB_GENERIC(0), vbo->generic_currval,
+ VERT_ATTRIB_GENERIC_MAX * sizeof(arrays[0]));
+ for (i = 0; i < VERT_ATTRIB_GENERIC_MAX; ++i) {
+ struct gl_client_array *array;
+ array = &arrays[VERT_ATTRIB_GENERIC(i)];
+ array->BufferObj = NULL;
+ _mesa_reference_buffer_object(ctx, &array->BufferObj,
vbo->generic_currval[i].BufferObj);
}
}