summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/varray.c
diff options
context:
space:
mode:
authorMathias Fröhlich <[email protected]>2018-12-21 18:41:27 +0100
committerMathias Fröhlich <[email protected]>2019-03-04 17:03:06 +0100
commite727f8c8b814b9c36d4a8b52829c2bf7281765be (patch)
treec5c77fdb8fff990c9c51525460b2c2cf6d836e68 /src/mesa/main/varray.c
parent9e787904d0a5c0dfde509a03f31f7a0c6f2993c3 (diff)
mesa: Track buffer object use also for VAO usage.
We already track the usage history for buffer objects in a lot of aspects. Add GL_ARRAY_BUFFER and GL_ELEMENT_ARRAY_BUFFER to gl_buffer_object::UsageHistory. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa/main/varray.c')
-rw-r--r--src/mesa/main/varray.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 5af5a7f773f..e6057c7f881 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -209,10 +209,12 @@ _mesa_bind_vertex_buffer(struct gl_context *ctx,
binding->Offset = offset;
binding->Stride = stride;
- if (!_mesa_is_bufferobj(vbo))
+ if (!_mesa_is_bufferobj(vbo)) {
vao->VertexAttribBufferMask &= ~binding->_BoundArrays;
- else
+ } else {
vao->VertexAttribBufferMask |= binding->_BoundArrays;
+ vbo->UsageHistory |= USAGE_ARRAY_BUFFER;
+ }
vao->NewArrays |= vao->Enabled & binding->_BoundArrays;
if (vao == ctx->Array.VAO)