* Handle reference counting.
*/
void
-_mesa_reference_sampler_object(struct gl_context *ctx,
- struct gl_sampler_object **ptr,
- struct gl_sampler_object *samp)
+_mesa_reference_sampler_object_(struct gl_context *ctx,
+ struct gl_sampler_object **ptr,
+ struct gl_sampler_object *samp)
{
- if (*ptr == samp)
- return;
+ assert(*ptr != samp); /* The inline wrapper should prevent no-op calls */
if (*ptr) {
/* Unreference the old sampler */
}
extern void
+_mesa_reference_sampler_object_(struct gl_context *ctx,
+ struct gl_sampler_object **ptr,
+ struct gl_sampler_object *samp);
+
+static inline void
_mesa_reference_sampler_object(struct gl_context *ctx,
struct gl_sampler_object **ptr,
- struct gl_sampler_object *samp);
+ struct gl_sampler_object *samp)
+{
+ if (*ptr != samp)
+ _mesa_reference_sampler_object_(ctx, ptr, samp);
+}
+
extern void
_mesa_init_sampler_object(struct gl_sampler_object *sampObj, GLuint name);