mesa: make _mesa_bufferobj_release_buffer static

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36715>
This commit is contained in:
Mike Blumenkrantz
2025-06-03 13:05:17 -04:00
committed by Marge Bot
parent b0468b5560
commit 4b8106ba4d
2 changed files with 19 additions and 22 deletions
+19 -20
View File
@@ -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.
*
-2
View File
@@ -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);