summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2018-01-12 09:18:32 -0700
committerBrian Paul <[email protected]>2018-01-17 11:17:56 -0700
commitb04195b9591604cbdf148781399c2253ccb73f14 (patch)
treec2f1834296384688cfbfca76b2551c78aef954c4
parent213bef62c31ed365253a1f3f6714290b8013051a (diff)
vbo: rename vbo_save_vertex_store::buffer to buffer_map
To match other parts of the VBO code and make things easier to understand. Reviewed-by: Ian Romanick <[email protected]>
-rw-r--r--src/mesa/vbo/vbo_save.h2
-rw-r--r--src/mesa/vbo/vbo_save_api.c25
-rw-r--r--src/mesa/vbo/vbo_save_draw.c2
3 files changed, 15 insertions, 14 deletions
diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h
index 8240261f02c..5eed3aeb740 100644
--- a/src/mesa/vbo/vbo_save.h
+++ b/src/mesa/vbo/vbo_save.h
@@ -108,7 +108,7 @@ struct vbo_save_vertex_list {
*/
struct vbo_save_vertex_store {
struct gl_buffer_object *bufferobj;
- fi_type *buffer;
+ fi_type *buffer_map;
GLuint used;
GLuint refcount;
};
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index ae5ee03a265..05ccb415ee8 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -213,7 +213,7 @@ alloc_vertex_store(struct gl_context *ctx)
_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;
@@ -225,7 +225,7 @@ static void
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);
@@ -245,7 +245,7 @@ vbo_save_map_vertex_store(struct gl_context *ctx,
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 */
@@ -257,12 +257,12 @@ vbo_save_map_vertex_store(struct gl_context *ctx,
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;
}
}
@@ -289,7 +289,7 @@ vbo_save_unmap_vertex_store(struct gl_context *ctx,
ctx->Driver.UnmapBuffer(ctx, vertex_store->bufferobj, MAP_INTERNAL);
}
- vertex_store->buffer = NULL;
+ vertex_store->buffer_map = NULL;
}
@@ -311,7 +311,7 @@ _save_reset_counters(struct gl_context *ctx)
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);
@@ -436,7 +436,7 @@ _save_compile_vertex_list(struct gl_context *ctx)
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;
@@ -462,7 +462,7 @@ _save_compile_vertex_list(struct gl_context *ctx)
*/
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;
@@ -504,7 +504,7 @@ _save_compile_vertex_list(struct gl_context *ctx)
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);
@@ -536,7 +536,8 @@ _save_compile_vertex_list(struct gl_context *ctx)
}
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) {
diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c
index 17eff9b3fac..4b79e9c5577 100644
--- a/src/mesa/vbo/vbo_save_draw.c
+++ b/src/mesa/vbo/vbo_save_draw.c
@@ -257,7 +257,7 @@ vbo_save_playback_vertex_list(struct gl_context *ctx, void *data)
struct vbo_save_context *save = &vbo_context(ctx)->save;
GLboolean remap_vertex_store = GL_FALSE;
- if (save->vertex_store && save->vertex_store->buffer) {
+ if (save->vertex_store && save->vertex_store->buffer_map) {
/* The vertex store is currently mapped but we're about to replay
* a display list. This can happen when a nested display list is
* being build with GL_COMPILE_AND_EXECUTE.