summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/program.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/program/program.h')
-rw-r--r--src/mesa/program/program.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mesa/program/program.h b/src/mesa/program/program.h
index ce37b95bf82..0f32a6af73b 100644
--- a/src/mesa/program/program.h
+++ b/src/mesa/program/program.h
@@ -89,9 +89,18 @@ extern struct gl_program *
_mesa_lookup_program(struct gl_context *ctx, GLuint id);
extern void
+_mesa_reference_program_(struct gl_context *ctx,
+ struct gl_program **ptr,
+ struct gl_program *prog);
+
+static INLINE void
_mesa_reference_program(struct gl_context *ctx,
struct gl_program **ptr,
- struct gl_program *prog);
+ struct gl_program *prog)
+{
+ if (*ptr != prog)
+ _mesa_reference_program_(ctx, ptr, prog);
+}
static INLINE void
_mesa_reference_vertprog(struct gl_context *ctx,