summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/bufferobj.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index cd561a0a271..ff1357df341 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -1468,21 +1468,14 @@ bind_atomic_buffer(struct gl_context *ctx, unsigned index,
* \param n Number of buffer objects to delete.
* \param ids Array of \c n buffer object IDs.
*/
-void GLAPIENTRY
-_mesa_DeleteBuffers(GLsizei n, const GLuint *ids)
+static void
+delete_buffers(struct gl_context *ctx, GLsizei n, const GLuint *ids)
{
- GET_CURRENT_CONTEXT(ctx);
- GLsizei i;
FLUSH_VERTICES(ctx, 0);
- if (n < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteBuffersARB(n)");
- return;
- }
-
_mesa_HashLockMutex(ctx->Shared->BufferObjects);
- for (i = 0; i < n; i++) {
+ for (GLsizei i = 0; i < n; i++) {
struct gl_buffer_object *bufObj =
_mesa_lookup_bufferobj_locked(ctx, ids[i]);
if (bufObj) {
@@ -1619,6 +1612,20 @@ _mesa_DeleteBuffers(GLsizei n, const GLuint *ids)
}
+void GLAPIENTRY
+_mesa_DeleteBuffers(GLsizei n, const GLuint *ids)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (n < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteBuffersARB(n)");
+ return;
+ }
+
+ delete_buffers(ctx, n, ids);
+}
+
+
/**
* This is the implementation for glGenBuffers and glCreateBuffers. It is not
* exposed to the rest of Mesa to encourage the use of nameless buffers in