summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-04-03 15:41:10 -0600
committerBrian Paul <[email protected]>2009-04-03 15:41:10 -0600
commit866bdd0509f665446b0fa8c29aa61c25e4be4732 (patch)
treec52149633362d0bce939eb65d0625511d29ce919 /src/mesa/shader
parenta4173956ebcc224b5a0d76bace07b87bdf8bed03 (diff)
mesa: fix parameter counting in ARB vertex/fragment program parsing
Duplicated unnamed constants were getting counted more than once.
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/arbprogparse.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index 6ef09fd91b0..35253daa2e6 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -1840,7 +1840,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
if (param_var->param_binding_begin == ~0U)
param_var->param_binding_begin = idx;
param_var->param_binding_length++;
- Program->Base.NumParameters++;
}
}
else {
@@ -1849,7 +1848,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
if (param_var->param_binding_begin == ~0U)
param_var->param_binding_begin = idx;
param_var->param_binding_length++;
- Program->Base.NumParameters++;
}
break;
@@ -1860,7 +1858,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
if (param_var->param_binding_begin == ~0U)
param_var->param_binding_begin = idx;
param_var->param_binding_length++;
- Program->Base.NumParameters++;
/* Check if there is more: 0 -> we're done, else its an integer */
if (**inst) {
@@ -1896,7 +1893,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
idx = _mesa_add_state_reference(Program->Base.Parameters,
state_tokens);
param_var->param_binding_length++;
- Program->Base.NumParameters++;
}
}
else {
@@ -1918,7 +1914,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
* instruction register type appropriately.
*/
param_var->param_binding_length++;
- Program->Base.NumParameters++;
break;
default:
@@ -1927,6 +1922,8 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
return 1;
}
+ Program->Base.NumParameters = Program->Base.Parameters->NumParameters;
+
/* Make sure we haven't blown past our parameter limits */
if (((Program->Base.Target == GL_VERTEX_PROGRAM_ARB) &&
(Program->Base.NumParameters >