summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/samplerobj.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/samplerobj.h')
-rw-r--r--src/mesa/main/samplerobj.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/main/samplerobj.h b/src/mesa/main/samplerobj.h
index ed495c3760b..a839010b7b9 100644
--- a/src/mesa/main/samplerobj.h
+++ b/src/mesa/main/samplerobj.h
@@ -28,6 +28,14 @@
struct dd_function_table;
+static INLINE struct gl_sampler_object *
+_mesa_get_samplerobj(struct gl_context *ctx, GLuint unit)
+{
+ if (ctx->Texture.Unit[unit].Sampler)
+ return ctx->Texture.Unit[unit].Sampler;
+ else
+ return &ctx->Texture.Unit[unit]._Current->Sampler;
+}
extern void
_mesa_reference_sampler_object(struct gl_context *ctx,