summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_save.c
diff options
context:
space:
mode:
authorMathias Fröhlich <[email protected]>2011-10-31 16:23:40 +0100
committerMathias Fröhlich <[email protected]>2011-11-29 06:35:44 +0100
commited42c2580717527b2005580940fc766d95bb6b0b (patch)
tree8c1c862691f1ed86eb66634d3f892ca6c0dc2c93 /src/mesa/vbo/vbo_save.c
parent104b81def4c09f3012e44778d104f00ff87dd4f0 (diff)
vbo: Use The VERT_{ATTRIB,BIT} defines.
Signed-off-by: Mathias Froehlich <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_save.c')
-rw-r--r--src/mesa/vbo/vbo_save.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/mesa/vbo/vbo_save.c b/src/mesa/vbo/vbo_save.c
index 4343b348180..e0270619118 100644
--- a/src/mesa/vbo/vbo_save.c
+++ b/src/mesa/vbo/vbo_save.c
@@ -63,15 +63,23 @@ void vbo_save_init( struct gl_context *ctx )
struct gl_client_array *arrays = save->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);
}
}