summaryrefslogtreecommitdiff
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-08-26 12:01:23 -0600
committerBrian Paul <brianp@vmware.com>2009-08-26 12:01:23 -0600
commit476290946e7bd3b7fe5688622127d8c6a9c7f367 (patch)
treeba31a644465765c2689877aa1626e479826ae301 /src/mesa/shader
parent2bcf787de1884dff34749d308eb245da457ef649 (diff)
parent488b3c4d1bc3d830477180759a42dbaf8f5801b0 (diff)
Merge branch 'mesa_7_5_branch'
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/shader_api.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index 42b7fa78b6..b52be128c3 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -1632,7 +1632,6 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program,
if (param->Type == PROGRAM_SAMPLER) {
/* This controls which texture unit which is used by a sampler */
- GLuint texUnit, sampler;
GLint i;
/* data type for setting samplers must be int */
@@ -1647,8 +1646,9 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program,
* common thing...
*/
for (i = 0; i < count; i++) {
- sampler = (GLuint) program->Parameters->ParameterValues[index + i][0];
- texUnit = ((GLuint *) values)[i];
+ GLuint sampler =
+ (GLuint) program->Parameters->ParameterValues[index + offset + i][0];
+ GLuint texUnit = ((GLuint *) values)[i];
/* check that the sampler (tex unit index) is legal */
if (texUnit >= ctx->Const.MaxTextureImageUnits) {
@@ -1659,6 +1659,10 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program,
/* This maps a sampler to a texture unit: */
if (sampler < MAX_SAMPLERS) {
+#if 0
+ _mesa_printf("Set program %p sampler %d '%s' to unit %u\n",
+ program, sampler, param->Name, texUnit);
+#endif
program->SamplerUnits[sampler] = texUnit;
}
}