summaryrefslogtreecommitdiff
path: root/src/mesa/shader/shader_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/shader_api.c')
-rw-r--r--src/mesa/shader/shader_api.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index d6dacdd679..bd258f8737 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -741,7 +741,8 @@ _mesa_get_uniform_location(GLcontext *ctx, GLuint program, const GLchar *name)
* We need to handle things like "e.c[0].b" as seen in the
* GLSL orange book, page 189.
*/
- if (u->Type == PROGRAM_UNIFORM && !strcmp(u->Name, name)) {
+ if ((u->Type == PROGRAM_UNIFORM ||
+ u->Type == PROGRAM_SAMPLER) && !strcmp(u->Name, name)) {
return loc;
}
}
@@ -925,6 +926,12 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
return;
}
}
+
+ if (shProg->Uniforms->Parameters[location].Type == PROGRAM_SAMPLER) {
+ _slang_resolve_samplers(shProg, &shProg->VertexProgram->Base);
+ _slang_resolve_samplers(shProg, &shProg->FragmentProgram->Base);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ }
}