+ cso_set_samplers(st->cso_context, shader_stage, *num_samplers, states);
+}
+
+
+static void
+update_samplers(struct st_context *st)
+{
+ const struct gl_context *ctx = st->ctx;
+
+ update_shader_samplers(st,
+ PIPE_SHADER_FRAGMENT,
+ &ctx->FragmentProgram._Current->Base,
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits,
+ st->state.samplers[PIPE_SHADER_FRAGMENT],
+ &st->state.num_samplers[PIPE_SHADER_FRAGMENT]);
+
+ update_shader_samplers(st,
+ PIPE_SHADER_VERTEX,
+ &ctx->VertexProgram._Current->Base,
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits,
+ st->state.samplers[PIPE_SHADER_VERTEX],
+ &st->state.num_samplers[PIPE_SHADER_VERTEX]);
+
+ if (ctx->GeometryProgram._Current) {
+ update_shader_samplers(st,
+ PIPE_SHADER_GEOMETRY,
+ &ctx->GeometryProgram._Current->Base,
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits,
+ st->state.samplers[PIPE_SHADER_GEOMETRY],
+ &st->state.num_samplers[PIPE_SHADER_GEOMETRY]);
+ }
+ if (ctx->TessCtrlProgram._Current) {
+ update_shader_samplers(st,
+ PIPE_SHADER_TESS_CTRL,
+ &ctx->TessCtrlProgram._Current->Base,
+ ctx->Const.Program[MESA_SHADER_TESS_CTRL].MaxTextureImageUnits,
+ st->state.samplers[PIPE_SHADER_TESS_CTRL],
+ &st->state.num_samplers[PIPE_SHADER_TESS_CTRL]);
+ }
+ if (ctx->TessEvalProgram._Current) {
+ update_shader_samplers(st,
+ PIPE_SHADER_TESS_EVAL,
+ &ctx->TessEvalProgram._Current->Base,
+ ctx->Const.Program[MESA_SHADER_TESS_EVAL].MaxTextureImageUnits,
+ st->state.samplers[PIPE_SHADER_TESS_EVAL],
+ &st->state.num_samplers[PIPE_SHADER_TESS_EVAL]);
+ }