From 6d3d9c1c6de33646b63d47892863939ee1b1e624 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 14:19:17 -0600 Subject: Replace _mesa_parameter_longest_name() with _mesa_longest_parameter_name(). The later takes a type parameter so we can match uniforms or attributes/inputs. Used by the GL_ACTIVE_ATTRIBUTE_MAX_LENGTH and GL_ACTIVE_UNIFORM_MAX_LENGTH queries. Fixes problem reported by Brad King in VTK. --- src/mesa/shader/prog_parameter.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (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 2c8a3407634..fe90ca6d7bb 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -586,18 +586,21 @@ _mesa_clone_parameter_list(const struct gl_program_parameter_list *list) /** - * Find longest name of any parameter in list. + * Find longest name of all uniform parameters in list. */ GLuint -_mesa_parameter_longest_name(const struct gl_program_parameter_list *list) +_mesa_longest_parameter_name(const struct gl_program_parameter_list *list, + enum register_file type) { GLuint i, maxLen = 0; if (!list) return 0; for (i = 0; i < list->NumParameters; i++) { - GLuint len = _mesa_strlen(list->Parameters[i].Name); - if (len > maxLen) - maxLen = len; + if (list->Parameters[i].Type == type) { + GLuint len = _mesa_strlen(list->Parameters[i].Name); + if (len > maxLen) + maxLen = len; + } } return maxLen; } -- cgit v1.2.3