mesa: inline mesa_initialize_buffer_object.

This has no other users now.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
This commit is contained in:
Dave Airlie 2021-12-09 14:23:56 +10:00 committed by Marge Bot
parent 131efc204d
commit ee283c49b7
2 changed files with 7 additions and 27 deletions

View File

@ -1110,27 +1110,6 @@ get_no_minmax_cache()
return disable;
}
/**
* Initialize a buffer object to default values.
*/
void
_mesa_initialize_buffer_object(struct gl_context *ctx,
struct gl_buffer_object *obj,
GLuint name)
{
memset(obj, 0, sizeof(struct gl_buffer_object));
obj->RefCount = 1;
obj->Name = name;
obj->Usage = GL_STATIC_DRAW_ARB;
simple_mtx_init(&obj->MinMaxCacheMutex, mtx_plain);
if (get_no_minmax_cache())
obj->UsageHistory |= USAGE_DISABLE_MINMAX_CACHE;
}
/**
* Callback called from _mesa_HashWalk()
*/
@ -1324,7 +1303,13 @@ _mesa_bufferobj_alloc(struct gl_context *ctx, GLuint id)
if (!buf)
return NULL;
_mesa_initialize_buffer_object(ctx, buf, id);
buf->RefCount = 1;
buf->Name = id;
buf->Usage = GL_STATIC_DRAW_ARB;
simple_mtx_init(&buf->MinMaxCacheMutex, mtx_plain);
if (get_no_minmax_cache())
buf->UsageHistory |= USAGE_DISABLE_MINMAX_CACHE;
return buf;
}
/**

View File

@ -156,11 +156,6 @@ _mesa_multi_bind_lookup_bufferobj(struct gl_context *ctx,
GLuint index, const char *caller,
bool *error);
extern void
_mesa_initialize_buffer_object(struct gl_context *ctx,
struct gl_buffer_object *obj,
GLuint name);
extern void
_mesa_delete_buffer_object(struct gl_context *ctx,
struct gl_buffer_object *bufObj);