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 <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
bufObj = ctx->Shared->NullBufferObj;
}
bufObj = ctx->Shared->NullBufferObj;
}
+ if (bufObj) {
+ bufObj->UsageHistory |= USAGE_ELEMENT_ARRAY_BUFFER;
_mesa_reference_buffer_object(ctx, &vao->IndexBufferObj, bufObj);
_mesa_reference_buffer_object(ctx, &vao->IndexBufferObj, bufObj);
switch (target) {
case GL_ARRAY_BUFFER_ARB:
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:
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;
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_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,
binding->Offset = offset;
binding->Stride = stride;
binding->Offset = offset;
binding->Stride = stride;
- if (!_mesa_is_bufferobj(vbo))
+ if (!_mesa_is_bufferobj(vbo)) {
vao->VertexAttribBufferMask &= ~binding->_BoundArrays;
vao->VertexAttribBufferMask &= ~binding->_BoundArrays;
vao->VertexAttribBufferMask |= binding->_BoundArrays;
vao->VertexAttribBufferMask |= binding->_BoundArrays;
+ vbo->UsageHistory |= USAGE_ARRAY_BUFFER;
+ }
vao->NewArrays |= vao->Enabled & binding->_BoundArrays;
if (vao == ctx->Array.VAO)
vao->NewArrays |= vao->Enabled & binding->_BoundArrays;
if (vao == ctx->Array.VAO)