summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo
diff options
context:
space:
mode:
authorMathias Fröhlich <mathias.froehlich@web.de>2018-02-25 18:01:07 +0100
committerMathias Fröhlich <mathias.froehlich@web.de>2018-03-01 04:06:23 +0100
commit4c232dc721645c147c864f102268a52c9536096d (patch)
tree96067e198bc2ac0f35dcb9c8e4fccd1d9394ce29 /src/mesa/vbo
parent478a9bc7bb6870993e2a8df97b2dab1d4e45a723 (diff)
vbo: Remove vbo_save_vertex_list::vertex_size.
Like before use local variables from compile_vertex_list instead. Remove vertex_size from struct vbo_save_vertex_list. Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r--src/mesa/vbo/vbo_save.h1
-rw-r--r--src/mesa/vbo/vbo_save_api.c14
2 files changed, 6 insertions, 9 deletions
diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h
index a9834d6e6d4..b158c077957 100644
--- a/src/mesa/vbo/vbo_save.h
+++ b/src/mesa/vbo/vbo_save.h
@@ -61,7 +61,6 @@ struct vbo_save_copied_vtx {
* compiled using the fallback opcode mechanism provided by dlist.c.
*/
struct vbo_save_vertex_list {
- GLuint vertex_size; /**< size in GLfloats */
struct gl_vertex_array_object *VAO[VP_MODE_MAX];
/* Copy of the final vertex from node->vertex_store->bufferobj.
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index e6cd04281e3..47ee355e725 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -543,7 +543,6 @@ compile_vertex_list(struct gl_context *ctx)
/* Duplicate our template, increment refcounts to the storage structs:
*/
const GLsizei stride = save->vertex_size*sizeof(GLfloat);
- node->vertex_size = save->vertex_size;
GLintptr buffer_offset =
(save->buffer_map - save->vertex_store->buffer_map) * sizeof(GLfloat);
GLuint start_offset = 0;
@@ -579,9 +578,8 @@ compile_vertex_list(struct gl_context *ctx)
for (gl_vertex_processing_mode vpm = VP_MODE_FF; vpm < VP_MODE_MAX; ++vpm) {
/* create or reuse the vao */
update_vao(ctx, vpm, &save->VAO[vpm],
- save->vertex_store->bufferobj, buffer_offset,
- node->vertex_size*sizeof(GLfloat), save->enabled,
- save->attrsz, save->attrtype, offsets);
+ save->vertex_store->bufferobj, buffer_offset, stride,
+ save->enabled, save->attrsz, save->attrtype, offsets);
/* Reference the vao in the dlist */
node->VAO[vpm] = NULL;
_mesa_reference_vao(ctx, &node->VAO[vpm], save->VAO[vpm]);
@@ -593,7 +591,7 @@ compile_vertex_list(struct gl_context *ctx)
node->current_data = NULL;
}
else {
- GLuint current_size = node->vertex_size - save->attrsz[0];
+ GLuint current_size = save->vertex_size - save->attrsz[0];
node->current_data = NULL;
if (current_size) {
@@ -604,8 +602,7 @@ compile_vertex_list(struct gl_context *ctx)
unsigned vertex_offset = 0;
if (node->vertex_count)
- vertex_offset =
- (node->vertex_count - 1) * node->vertex_size * sizeof(GLfloat);
+ vertex_offset = (node->vertex_count - 1) * stride;
memcpy(node->current_data, buffer + vertex_offset + attr_offset,
current_size * sizeof(GLfloat));
@@ -1817,11 +1814,12 @@ vbo_print_vertex_list(struct gl_context *ctx, void *data, FILE *f)
struct vbo_save_vertex_list *node = (struct vbo_save_vertex_list *) data;
GLuint i;
struct gl_buffer_object *buffer = node->VAO[0]->BufferBinding[0].BufferObj;
+ const GLuint vertex_size = _vbo_save_get_stride(node)/sizeof(GLfloat);
(void) ctx;
fprintf(f, "VBO-VERTEX-LIST, %u vertices, %d primitives, %d vertsize, "
"buffer %p\n",
- node->vertex_count, node->prim_count, node->vertex_size,
+ node->vertex_count, node->prim_count, vertex_size,
buffer);
for (i = 0; i < node->prim_count; i++) {