_mesa_install_save_vtxfmt(ctx, &save->vtxfmt_noop);
}
- vertex_store->buffer = NULL;
+ vertex_store->buffer_map = NULL;
vertex_store->used = 0;
vertex_store->refcount = 1;
free_vertex_store(struct gl_context *ctx,
struct vbo_save_vertex_store *vertex_store)
{
- assert(!vertex_store->buffer);
+ assert(!vertex_store->buffer_map);
if (vertex_store->bufferobj) {
_mesa_reference_buffer_object(ctx, &vertex_store->bufferobj, NULL);
GL_MAP_FLUSH_EXPLICIT_BIT);
assert(vertex_store->bufferobj);
- assert(!vertex_store->buffer); /* the buffer should not be mapped */
+ assert(!vertex_store->buffer_map); /* the buffer should not be mapped */
if (vertex_store->bufferobj->Size > 0) {
/* Map the remaining free space in the VBO */
MAP_INTERNAL);
if (range) {
/* compute address of start of whole buffer (needed elsewhere) */
- vertex_store->buffer = range - vertex_store->used;
- assert(vertex_store->buffer);
+ vertex_store->buffer_map = range - vertex_store->used;
+ assert(vertex_store->buffer_map);
return range;
}
else {
- vertex_store->buffer = NULL;
+ vertex_store->buffer_map = NULL;
return NULL;
}
}
ctx->Driver.UnmapBuffer(ctx, vertex_store->bufferobj, MAP_INTERNAL);
}
- vertex_store->buffer = NULL;
+ vertex_store->buffer_map = NULL;
}
struct vbo_save_context *save = &vbo_context(ctx)->save;
save->prim = save->prim_store->prims + save->prim_store->used;
- save->buffer = save->vertex_store->buffer + save->vertex_store->used;
+ save->buffer = save->vertex_store->buffer_map + save->vertex_store->used;
assert(save->buffer == save->buffer_ptr);
memcpy(node->attrtype, save->attrtype, sizeof(node->attrtype));
node->vertex_size = save->vertex_size;
node->buffer_offset =
- (save->buffer - save->vertex_store->buffer) * sizeof(GLfloat);
+ (save->buffer - save->vertex_store->buffer_map) * sizeof(GLfloat);
node->count = save->vert_count;
node->wrap_count = save->copied.nr;
node->dangling_attr_ref = save->dangling_attr_ref;
*/
node->current_data = malloc(node->current_size * sizeof(GLfloat));
if (node->current_data) {
- const char *buffer = (const char *) save->vertex_store->buffer;
+ const char *buffer = (const char *) save->vertex_store->buffer_map;
unsigned attr_offset = node->attrsz[0] * sizeof(GLfloat);
unsigned vertex_offset = 0;
vbo_loopback_vertex_list(ctx,
(const GLfloat *) ((const char *) save->
- vertex_store->buffer +
+ vertex_store->buffer_map +
node->buffer_offset),
node->attrsz, node->prim, node->prim_count,
node->wrap_count, node->vertex_size);
}
else {
/* update buffer_ptr for next vertex */
- save->buffer_ptr = save->vertex_store->buffer + save->vertex_store->used;
+ save->buffer_ptr = save->vertex_store->buffer_map
+ + save->vertex_store->used;
}
if (save->prim_store->used > VBO_SAVE_PRIM_SIZE - 6) {