diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 7569e249362..b69b0b60108 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -255,6 +255,25 @@ buffer_usage(GLenum target, GLboolean immutable, } } +static void +_mesa_bufferobj_release_buffer(struct gl_buffer_object *obj) +{ + if (!obj->buffer) + return; + + /* Subtract the remaining private references before unreferencing + * the buffer. See the header file for explanation. + */ + if (obj->private_refcount) { + assert(obj->private_refcount > 0); + p_atomic_add(&obj->buffer->reference.count, + -obj->private_refcount); + obj->private_refcount = 0; + } + obj->private_refcount_ctx = NULL; + + pipe_resource_reference(&obj->buffer, NULL); +} static ALWAYS_INLINE GLboolean bufferobj_data(struct gl_context *ctx, @@ -1008,26 +1027,6 @@ convert_clear_buffer_data(struct gl_context *ctx, } } -void -_mesa_bufferobj_release_buffer(struct gl_buffer_object *obj) -{ - if (!obj->buffer) - return; - - /* Subtract the remaining private references before unreferencing - * the buffer. See the header file for explanation. - */ - if (obj->private_refcount) { - assert(obj->private_refcount > 0); - p_atomic_add(&obj->buffer->reference.count, - -obj->private_refcount); - obj->private_refcount = 0; - } - obj->private_refcount_ctx = NULL; - - pipe_resource_reference(&obj->buffer, NULL); -} - /** * Delete a buffer object. * diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index f89bf1be25f..e67bd4eb9f9 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -104,8 +104,6 @@ GLboolean _mesa_bufferobj_unmap(struct gl_context *ctx, struct gl_buffer_object struct gl_buffer_object * _mesa_bufferobj_alloc(struct gl_context *ctx, GLuint id); -void -_mesa_bufferobj_release_buffer(struct gl_buffer_object *obj); enum pipe_map_flags _mesa_access_flags_to_transfer_flags(GLbitfield access, bool wholeBuffer);