diff options
author | Brian Paul <[email protected]> | 2009-04-17 13:55:58 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-04-17 16:10:26 -0600 |
commit | 905130852ac481cb286b0215d8c61e9eb6845520 (patch) | |
tree | a534ed4be500adb4625028e91847b95cdd4d2f15 /src/mesa/shader | |
parent | 4c13cb65a0ee44d10298a1efe78c901c642b7ebe (diff) |
mesa: build a float[4] value in _mesa_add_sampler() to avoid random values
Diffstat (limited to 'src/mesa/shader')
-rw-r--r-- | src/mesa/shader/prog_parameter.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index e9ed3985ee2..bcd8c5d9dc0 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -327,15 +327,16 @@ _mesa_add_sampler(struct gl_program_parameter_list *paramList, else { GLuint i; const GLint size = 1; /* a sampler is basically a texture unit number */ - GLfloat value; + GLfloat value[4]; GLint numSamplers = 0; for (i = 0; i < paramList->NumParameters; i++) { if (paramList->Parameters[i].Type == PROGRAM_SAMPLER) numSamplers++; } - value = (GLfloat) numSamplers; + value[0] = (GLfloat) numSamplers; + value[1] = value[2] = value[3] = 0.0F; (void) _mesa_add_parameter(paramList, PROGRAM_SAMPLER, name, - size, datatype, &value, NULL, 0x0); + size, datatype, value, NULL, 0x0); return numSamplers; } } |