diff options
author | Eric Anholt <[email protected]> | 2010-08-05 17:00:12 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2010-08-06 00:51:42 -0700 |
commit | c234d0b25f622a7bdd3c40bc72fdbd59d8494c7c (patch) | |
tree | 4fd283b320db75af56053dd5d8bad3894fa7f306 /src/mesa/program/prog_parameter.c | |
parent | 199c441239762eec86b3cb4b558aef486907a8b6 (diff) |
ir_to_mesa: Add support for sampler arrays.
Support for samplers in general is still incomplete -- anything in a
uniform struct will still be broken. But that doesn't appear to be
any different from master.
Fixes:
glsl-fs-uniform-sampler-array.shader_test
Diffstat (limited to 'src/mesa/program/prog_parameter.c')
-rw-r--r-- | src/mesa/program/prog_parameter.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/program/prog_parameter.c b/src/mesa/program/prog_parameter.c index ddbfe95c152..fa5deaf127d 100644 --- a/src/mesa/program/prog_parameter.c +++ b/src/mesa/program/prog_parameter.c @@ -344,18 +344,19 @@ _mesa_use_uniform(struct gl_program_parameter_list *paramList, */ GLint _mesa_add_sampler(struct gl_program_parameter_list *paramList, - const char *name, GLenum datatype) + const char *name, GLenum datatype, int array_length) { GLint i = _mesa_lookup_parameter_index(paramList, -1, name); if (i >= 0 && paramList->Parameters[i].Type == PROGRAM_SAMPLER) { - ASSERT(paramList->Parameters[i].Size == 1); + ASSERT(paramList->Parameters[i].Size == 4 * array_length); ASSERT(paramList->Parameters[i].DataType == datatype); /* already in list */ return (GLint) paramList->ParameterValues[i][0]; } else { GLuint i; - const GLint size = 1; /* a sampler is basically a texture unit number */ + /* One integer texture unit number goes in each parameter location. */ + const GLint size = 4 * array_length; GLfloat value[4]; GLint numSamplers = 0; for (i = 0; i < paramList->NumParameters; i++) { |