diff options
author | Brian Paul <brianp@vmware.com> | 2009-04-07 08:34:32 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-04-07 08:34:32 -0600 |
commit | a18216308a38e158bf11e4b952b27d31edaa28aa (patch) | |
tree | a073f5209543720809e268a89c6a88be5414449a | |
parent | 14f13fbcfabb699d0308feb88a528056f2b39c47 (diff) |
mesa: fix parameter counting in ARB vertex/fragment program parsing
Duplicated unnamed constants were getting counted more than once.
(cherry picked from master, commit 866bdd0509f665446b0fa8c29aa61c25e4be4732)
-rw-r--r-- | src/mesa/shader/arbprogparse.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 8b7b5b1dbd..810a7b8f3e 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -1823,7 +1823,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 { @@ -1832,7 +1831,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; @@ -1843,7 +1841,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) { @@ -1879,7 +1876,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 { @@ -1897,7 +1893,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst, param_var->param_binding_begin = idx; param_var->param_binding_type = PROGRAM_CONSTANT; param_var->param_binding_length++; - Program->Base.NumParameters++; break; default: @@ -1906,6 +1901,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 > |