diff options
author | Mathias Fröhlich <[email protected]> | 2018-02-03 21:16:19 +0100 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2018-02-23 05:34:01 +0100 |
commit | ef8028017ddd0aa27d0db07c0d7409d0519de6fe (patch) | |
tree | 11ffa0218a02c2de2c089229af2381af7bcba1d7 /src/mesa/main/varray.c | |
parent | 354b76ad2070f23b91de14dd6bf4d14ff13e43fc (diff) |
mesa: Add flush_vertices to _mesa_bind_vertex_buffer.
We will need the flush_vertices argument later in this series.
Signed-off-by: Mathias Fröhlich <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/varray.c')
-rw-r--r-- | src/mesa/main/varray.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index f7d32fdbefc..bcd78373f50 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -194,7 +194,7 @@ _mesa_bind_vertex_buffer(struct gl_context *ctx, struct gl_vertex_array_object *vao, GLuint index, struct gl_buffer_object *vbo, - GLintptr offset, GLsizei stride) + GLintptr offset, GLsizei stride, bool flush_vertices) { assert(index < ARRAY_SIZE(vao->BufferBinding)); struct gl_vertex_buffer_binding *binding = &vao->BufferBinding[index]; @@ -202,8 +202,9 @@ _mesa_bind_vertex_buffer(struct gl_context *ctx, if (binding->BufferObj != vbo || binding->Offset != offset || binding->Stride != stride) { - - FLUSH_VERTICES(ctx, _NEW_ARRAY); + if (flush_vertices) { + FLUSH_VERTICES(ctx, _NEW_ARRAY); + } _mesa_reference_buffer_object(ctx, &binding->BufferObj, vbo); @@ -605,7 +606,7 @@ update_array(struct gl_context *ctx, GLsizei effectiveStride = stride != 0 ? stride : array->_ElementSize; _mesa_bind_vertex_buffer(ctx, vao, attrib, ctx->Array.ArrayBufferObj, (GLintptr) ptr, - effectiveStride); + effectiveStride, true); } void GLAPIENTRY @@ -2118,7 +2119,7 @@ vertex_array_vertex_buffer(struct gl_context *ctx, } _mesa_bind_vertex_buffer(ctx, vao, VERT_ATTRIB_GENERIC(bindingIndex), - vbo, offset, stride); + vbo, offset, stride, true); } @@ -2270,7 +2271,7 @@ vertex_array_vertex_buffers(struct gl_context *ctx, for (i = 0; i < count; i++) _mesa_bind_vertex_buffer(ctx, vao, VERT_ATTRIB_GENERIC(first + i), - vbo, 0, 16); + vbo, 0, 16, true); return; } @@ -2344,7 +2345,7 @@ vertex_array_vertex_buffers(struct gl_context *ctx, } _mesa_bind_vertex_buffer(ctx, vao, VERT_ATTRIB_GENERIC(first + i), - vbo, offsets[i], strides[i]); + vbo, offsets[i], strides[i], true); } _mesa_HashUnlockMutex(ctx->Shared->BufferObjects); |