bufObj = ctx->Shared->NullBufferObj;
}
- if (bufObj)
+ if (bufObj) {
+ bufObj->UsageHistory |= USAGE_ELEMENT_ARRAY_BUFFER;
_mesa_reference_buffer_object(ctx, &vao->IndexBufferObj, bufObj);
+ }
}
switch (target) {
case GL_ARRAY_BUFFER_ARB:
+ if (ctx->Array.ArrayBufferObj)
+ ctx->Array.ArrayBufferObj->UsageHistory |= USAGE_ARRAY_BUFFER;
return &ctx->Array.ArrayBufferObj;
case GL_ELEMENT_ARRAY_BUFFER_ARB:
+ if (ctx->Array.VAO->IndexBufferObj)
+ ctx->Array.VAO->IndexBufferObj->UsageHistory
+ |= USAGE_ELEMENT_ARRAY_BUFFER;
return &ctx->Array.VAO->IndexBufferObj;
case GL_PIXEL_PACK_BUFFER_EXT:
return &ctx->Pack.BufferObj;
USAGE_SHADER_STORAGE_BUFFER = 0x8,
USAGE_TRANSFORM_FEEDBACK_BUFFER = 0x10,
USAGE_PIXEL_PACK_BUFFER = 0x20,
- USAGE_DISABLE_MINMAX_CACHE = 0x40,
+ USAGE_ARRAY_BUFFER = 0x40,
+ USAGE_ELEMENT_ARRAY_BUFFER = 0x80,
+ USAGE_DISABLE_MINMAX_CACHE = 0x100,
} gl_buffer_usage;
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)