summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_texture.h
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2011-04-10 12:44:46 -0600
committerBrian Paul <brianp@vmware.com>2011-04-10 13:12:49 -0600
commitecfaab88b2577bd0395bc05d75a036126806a9c4 (patch)
tree5abb78f767f546778d551a57f7f2cfe20c479f50 /src/mesa/state_tracker/st_texture.h
parent1cbd3a1cc734df16610a59dc49cdb42c70dc3270 (diff)
downloadexternal_mesa3d-ecfaab88b2577bd0395bc05d75a036126806a9c4.zip
external_mesa3d-ecfaab88b2577bd0395bc05d75a036126806a9c4.tar.gz
external_mesa3d-ecfaab88b2577bd0395bc05d75a036126806a9c4.tar.bz2
mesa: move sampler state into new gl_sampler_object type
gl_texture_object contains an instance of this type for the regular texture object sampling state. glGenSamplers() generates new instances of gl_sampler_object which can override that state with glBindSampler().
Diffstat (limited to 'src/mesa/state_tracker/st_texture.h')
-rw-r--r--src/mesa/state_tracker/st_texture.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_texture.h b/src/mesa/state_tracker/st_texture.h
index d50c3c9..903e30d 100644
--- a/src/mesa/state_tracker/st_texture.h
+++ b/src/mesa/state_tracker/st_texture.h
@@ -163,6 +163,21 @@ st_get_texture_sampler_view(struct st_texture_object *stObj,
}
+/**
+ * Get pointer to the active sampler object for the given texture unit.
+ * This will either be a user-defined sampler object or the texture
+ * object's own sampler state.
+ */
+static INLINE struct gl_sampler_object *
+st_get_mesa_sampler(const 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 struct pipe_resource *
st_texture_create(struct st_context *st,
enum pipe_texture_target target,