summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/prog_parameter.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-04-18 16:05:53 -0600
committerBrian <[email protected]>2007-04-18 17:14:13 -0600
commit274ac7a801766a0ae766219ec6a40ed52e479d07 (patch)
tree2a0f770a8278e4556879ad101c3c866cf43f9b02 /src/mesa/shader/prog_parameter.c
parentaaa57412c1a682730f27f08bd89a79b8b81f982f (diff)
Fix some bugs related to querying active uniforms.
Diffstat (limited to 'src/mesa/shader/prog_parameter.c')
-rw-r--r--src/mesa/shader/prog_parameter.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c
index fe90ca6d7bb..e2f1047463f 100644
--- a/src/mesa/shader/prog_parameter.c
+++ b/src/mesa/shader/prog_parameter.c
@@ -605,3 +605,20 @@ _mesa_longest_parameter_name(const struct gl_program_parameter_list *list,
return maxLen;
}
+
+/**
+ * Count the number of parameters in the last that match the given type.
+ */
+GLuint
+_mesa_num_parameters_of_type(const struct gl_program_parameter_list *list,
+ enum register_file type)
+{
+ GLuint i, count = 0;
+ if (list) {
+ for (i = 0; i < list->NumParameters; i++) {
+ if (list->Parameters[i].Type == type)
+ count++;
+ }
+ }
+ return count;
+}