+ if (swizzle != SWIZZLE_NOOP) {
+ templ.swizzle_r = GET_SWZ(swizzle, 0);
+ templ.swizzle_g = GET_SWZ(swizzle, 1);
+ templ.swizzle_b = GET_SWZ(swizzle, 2);
+ templ.swizzle_a = GET_SWZ(swizzle, 3);
+ }
+
+ return pipe->create_sampler_view(pipe, stObj->pt, &templ);
+}
+
+
+static struct pipe_sampler_view *
+st_get_texture_sampler_view_from_stobj(struct st_texture_object *stObj,
+ struct pipe_context *pipe,
+ const struct gl_sampler_object *samp,
+ enum pipe_format format)
+{
+ if (!stObj || !stObj->pt) {
+ return NULL;
+ }
+
+ if (!stObj->sampler_view) {
+ stObj->sampler_view =
+ st_create_texture_sampler_view_from_stobj(pipe, stObj, samp, format);
+ }
+
+ return stObj->sampler_view;
+}
+
+
+static GLboolean
+update_single_texture(struct st_context *st,
+ struct pipe_sampler_view **sampler_view,
+ GLuint texUnit)
+{
+ struct pipe_context *pipe = st->pipe;
+ struct gl_context *ctx = st->ctx;
+ const struct gl_sampler_object *samp;
+ struct gl_texture_object *texObj;
+ struct st_texture_object *stObj;
+ enum pipe_format view_format;
+ GLboolean retval;
+
+ samp = _mesa_get_samplerobj(ctx, texUnit);
+
+ texObj = ctx->Texture.Unit[texUnit]._Current;