From 1fad6ccb756ae33ca3115f59c99ca8abbeb0321e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 2 Jan 2009 12:26:15 -0700 Subject: mesa: fix another "out of samplers" problem Now only the samplers that are actually used by texture() functions are saved in the uniform variable list. Before, we could run out of samplers if too many were declared while only some of them were actually used. --- src/mesa/shader/prog_parameter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa/shader/prog_parameter.c') diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index c0602ad2c94..dc48e84ab29 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -290,7 +290,8 @@ _mesa_use_uniform(struct gl_program_parameter_list *paramList, GLuint i; for (i = 0; i < paramList->NumParameters; i++) { struct gl_program_parameter *p = paramList->Parameters + i; - if (p->Type == PROGRAM_UNIFORM && _mesa_strcmp(p->Name, name) == 0) { + if ((p->Type == PROGRAM_UNIFORM || p->Type == PROGRAM_SAMPLER) && + _mesa_strcmp(p->Name, name) == 0) { p->Used = GL_TRUE; /* Note that large uniforms may occupy several slots so we're * not done searching yet. -- cgit v1.2.3