summaryrefslogtreecommitdiff
path: root/src/mesa/main/samplerobj.h
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2011-04-20 11:48:31 -0700
committerEric Anholt <eric@anholt.net>2011-04-23 13:21:57 -0700
commit1f32c665c8af0622e2bbf451edb999ffbcd7d0fe (patch)
tree42deb7077604e541224b15de3c65eefaea605922 /src/mesa/main/samplerobj.h
parent1df72402d99145425531297eef6772b88ce5225d (diff)
intel: Add support for ARB_sampler_objects.
This extension support consists of replacing "gl_texture_obj->Sampler." with "_mesa_get_samplerobj(ctx, unit)->". One instance of referencing the texture's base sampler remains in the initial miptree allocation, where I'm not sure we have a clear association with any texture unit. Tested with piglit ARB_sampler_objects/sampler-objects. Reviewed-by: Brian Paul <brianp@vmware.com>
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,