aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/samplerobj.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-03-17 16:30:03 -0600
committerBrian Paul <[email protected]>2012-03-20 08:23:32 -0600
commit3f7509beffaf924a22227e70b499326393c5b885 (patch)
tree7f297d85a980d8ca60781c8b69e5551dfeb2c7d2 /src/mesa/main/samplerobj.c
parent0225a15b6907b51dbbc9602a1f0cb07ee809f496 (diff)
mesa: make _mesa_reference_sampler_object() an inline function
To make the no-change case faster, as we do for the other object-reference functions. Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/samplerobj.c')
-rw-r--r--src/mesa/main/samplerobj.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
index 7cf0654ada2..5d1b2adbb08 100644
--- a/src/mesa/main/samplerobj.c
+++ b/src/mesa/main/samplerobj.c
@@ -55,12 +55,11 @@ _mesa_lookup_samplerobj(struct gl_context *ctx, GLuint name)
* 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 */