mesa: make _mesa_reference_array_object() an inline function
As we do for texture objects, buffer objects, etc.
This commit is contained in:
@@ -123,14 +123,15 @@ _mesa_delete_array_object( struct gl_context *ctx, struct gl_array_object *obj )
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set ptr to arrayObj w/ reference counting.
|
* Set ptr to arrayObj w/ reference counting.
|
||||||
|
* Note: this should only be called from the _mesa_reference_array_object()
|
||||||
|
* inline function.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
_mesa_reference_array_object(struct gl_context *ctx,
|
_mesa_reference_array_object_(struct gl_context *ctx,
|
||||||
struct gl_array_object **ptr,
|
struct gl_array_object **ptr,
|
||||||
struct gl_array_object *arrayObj)
|
struct gl_array_object *arrayObj)
|
||||||
{
|
{
|
||||||
if (*ptr == arrayObj)
|
assert(*ptr != arrayObj);
|
||||||
return;
|
|
||||||
|
|
||||||
if (*ptr) {
|
if (*ptr) {
|
||||||
/* Unreference the old array object */
|
/* Unreference the old array object */
|
||||||
|
@@ -52,9 +52,19 @@ extern void
|
|||||||
_mesa_delete_array_object( struct gl_context *ctx, struct gl_array_object *obj );
|
_mesa_delete_array_object( struct gl_context *ctx, struct gl_array_object *obj );
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
|
_mesa_reference_array_object_(struct gl_context *ctx,
|
||||||
|
struct gl_array_object **ptr,
|
||||||
|
struct gl_array_object *arrayObj);
|
||||||
|
|
||||||
|
static inline void
|
||||||
_mesa_reference_array_object(struct gl_context *ctx,
|
_mesa_reference_array_object(struct gl_context *ctx,
|
||||||
struct gl_array_object **ptr,
|
struct gl_array_object **ptr,
|
||||||
struct gl_array_object *arrayObj);
|
struct gl_array_object *arrayObj)
|
||||||
|
{
|
||||||
|
if (*ptr != arrayObj)
|
||||||
|
_mesa_reference_array_object_(ctx, ptr, arrayObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
_mesa_initialize_array_object( struct gl_context *ctx,
|
_mesa_initialize_array_object( struct gl_context *ctx,
|
||||||
|
Reference in New Issue
Block a user