From 905130852ac481cb286b0215d8c61e9eb6845520 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 17 Apr 2009 13:55:58 -0600 Subject: mesa: build a float[4] value in _mesa_add_sampler() to avoid random values --- src/mesa/shader/prog_parameter.c | 7 ++++--- 1 file 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; } } -- cgit v1.2.3