summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/shader/prog_parameter.c13
-rw-r--r--src/mesa/shader/prog_parameter.h4
-rw-r--r--src/mesa/shader/shader_api.c4
3 files changed, 13 insertions, 8 deletions
diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c
index 2c8a340763..fe90ca6d7b 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;
}
diff --git a/src/mesa/shader/prog_parameter.h b/src/mesa/shader/prog_parameter.h
index 3d32a64f38..879623b127 100644
--- a/src/mesa/shader/prog_parameter.h
+++ b/src/mesa/shader/prog_parameter.h
@@ -131,6 +131,8 @@ _mesa_lookup_parameter_constant(const struct gl_program_parameter_list *list,
GLint *posOut, GLuint *swizzleOut);
extern 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);
+
#endif /* PROG_PARAMETER_H */
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index fc1ae287f4..41646e7664 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -763,13 +763,13 @@ _mesa_get_programiv(GLcontext *ctx, GLuint program,
*params = shProg->Attributes ? shProg->Attributes->NumParameters : 0;
break;
case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
- *params = _mesa_parameter_longest_name(shProg->Attributes);
+ *params = _mesa_longest_parameter_name(shProg->Attributes, PROGRAM_INPUT);
break;
case GL_ACTIVE_UNIFORMS:
*params = shProg->Uniforms ? shProg->Uniforms->NumParameters : 0;
break;
case GL_ACTIVE_UNIFORM_MAX_LENGTH:
- *params = _mesa_parameter_longest_name(shProg->Uniforms);
+ *params = _mesa_longest_parameter_name(shProg->Uniforms, PROGRAM_UNIFORM);
break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)");