aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/samplerobj.h
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/samplerobj.h')
-rw-r--r--mesalib/src/mesa/main/samplerobj.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/samplerobj.h b/mesalib/src/mesa/main/samplerobj.h
index ed495c376..a839010b7 100644
--- a/mesalib/src/mesa/main/samplerobj.h
+++ b/mesalib/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,