diff options
author | Brian Paul <[email protected]> | 2018-01-15 14:48:07 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-01-17 11:17:56 -0700 |
commit | 380165d3994d53d245343dec2ae6b4ebd8fde6d2 (patch) | |
tree | ff02d7af0497338fcd725f45c23db2035086c418 /src/mesa/vbo/vbo_save_draw.c | |
parent | 37863c38f3292e5a8c3ff0396fd92113a2a5b4e8 (diff) |
vbo: use a new local 'array' variable in bind_vertex_list() loop
Make the code a bit more concise.
Reviewed-by: Ian Romanick <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_save_draw.c')
-rw-r--r-- | src/mesa/vbo/vbo_save_draw.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index c1298f95a0c..5d299d8c325 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -201,22 +201,23 @@ bind_vertex_list(struct gl_context *ctx, const GLuint src = map[attr]; if (node_attrsz[src]) { + struct gl_vertex_array *array = &arrays[attr]; + /* override the default array set above */ - save->inputs[attr] = &arrays[attr]; - - arrays[attr].Ptr = (const GLubyte *) NULL + buffer_offset; - arrays[attr].Size = node_attrsz[src]; - arrays[attr].StrideB = node->vertex_size * sizeof(GLfloat); - arrays[attr].Type = node_attrtype[src]; - arrays[attr].Integer = - vbo_attrtype_to_integer_flag(node_attrtype[src]); - arrays[attr].Format = GL_RGBA; - arrays[attr]._ElementSize = arrays[attr].Size * sizeof(GLfloat); + save->inputs[attr] = array; + + array->Ptr = (const GLubyte *) NULL + buffer_offset; + array->Size = node_attrsz[src]; + array->StrideB = node->vertex_size * sizeof(GLfloat); + array->Type = node_attrtype[src]; + array->Integer = vbo_attrtype_to_integer_flag(node_attrtype[src]); + array->Format = GL_RGBA; + array->_ElementSize = array->Size * sizeof(GLfloat); _mesa_reference_buffer_object(ctx, - &arrays[attr].BufferObj, + &array->BufferObj, node->vertex_store->bufferobj); - assert(arrays[attr].BufferObj->Name); + assert(array->BufferObj->Name); buffer_offset += node_attrsz[src] * sizeof(GLfloat); varying_inputs |= VERT_BIT(attr); |