diff options
Diffstat (limited to 'mesalib/src/mesa/program/prog_parameter.c')
-rw-r--r-- | mesalib/src/mesa/program/prog_parameter.c | 100 |
1 files changed, 6 insertions, 94 deletions
diff --git a/mesalib/src/mesa/program/prog_parameter.c b/mesalib/src/mesa/program/prog_parameter.c index b9f4d9d57..8713d57b5 100644 --- a/mesalib/src/mesa/program/prog_parameter.c +++ b/mesalib/src/mesa/program/prog_parameter.c @@ -109,8 +109,7 @@ _mesa_add_parameter(struct gl_program_parameter_list *paramList, gl_register_file type, const char *name, GLuint size, GLenum datatype, const gl_constant_value *values, - const gl_state_index state[STATE_LENGTH], - GLbitfield flags) + const gl_state_index state[STATE_LENGTH]) { const GLuint oldNum = paramList->NumParameters; const GLuint sz4 = (size + 3) / 4; /* no. of new param slots needed */ @@ -155,7 +154,6 @@ _mesa_add_parameter(struct gl_program_parameter_list *paramList, p->Type = type; p->Size = size; p->DataType = datatype; - p->Flags = flags; if (values) { COPY_4V(paramList->ParameterValues[oldNum + i], values); values += 4; @@ -180,20 +178,6 @@ _mesa_add_parameter(struct gl_program_parameter_list *paramList, /** - * Add a new named program parameter (Ex: NV_fragment_program DEFINE statement) - * \return index of the new entry in the parameter list - */ -GLint -_mesa_add_named_parameter(struct gl_program_parameter_list *paramList, - const char *name, const gl_constant_value values[4]) -{ - return _mesa_add_parameter(paramList, PROGRAM_NAMED_PARAM, name, - 4, GL_NONE, values, NULL, 0x0); - -} - - -/** * Add a new named constant to the parameter list. * This will be used when the program contains something like this: * PARAM myVals = { 0, 1, 2, 3 }; @@ -223,7 +207,7 @@ _mesa_add_named_constant(struct gl_program_parameter_list *paramList, } /* not found, add new parameter */ return _mesa_add_parameter(paramList, PROGRAM_CONSTANT, name, - size, GL_NONE, values, NULL, 0x0); + size, GL_NONE, values, NULL); } @@ -275,7 +259,7 @@ _mesa_add_typed_unnamed_constant(struct gl_program_parameter_list *paramList, /* add a new parameter to store this constant */ pos = _mesa_add_parameter(paramList, PROGRAM_CONSTANT, NULL, - size, datatype, values, NULL, 0x0); + size, datatype, values, NULL); if (pos >= 0 && swizzleOut) { if (size == 1) *swizzleOut = SWIZZLE_XXXX; @@ -307,58 +291,6 @@ _mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList, swizzleOut); } -/** - * Add parameter representing a varying variable. - */ -GLint -_mesa_add_varying(struct gl_program_parameter_list *paramList, - const char *name, GLuint size, GLenum datatype, - GLbitfield flags) -{ - GLint i = _mesa_lookup_parameter_index(paramList, -1, name); - if (i >= 0 && paramList->Parameters[i].Type == PROGRAM_VARYING) { - /* already in list */ - return i; - } - else { - /*assert(size == 4);*/ - i = _mesa_add_parameter(paramList, PROGRAM_VARYING, name, - size, datatype, NULL, NULL, flags); - return i; - } -} - - -/** - * Add parameter representing a vertex program attribute. - * \param size size of attribute (in floats), may be -1 if unknown - * \param attrib the attribute index, or -1 if unknown - */ -GLint -_mesa_add_attribute(struct gl_program_parameter_list *paramList, - const char *name, GLint size, GLenum datatype, GLint attrib) -{ - GLint i = _mesa_lookup_parameter_index(paramList, -1, name); - if (i >= 0) { - /* replace */ - if (attrib < 0) - attrib = i; - paramList->Parameters[i].StateIndexes[0] = attrib; - } - else { - /* add */ - gl_state_index state[STATE_LENGTH]; - state[0] = (gl_state_index) attrib; - if (size < 0) - size = 4; - i = _mesa_add_parameter(paramList, PROGRAM_INPUT, name, - size, datatype, NULL, state, 0x0); - } - return i; -} - - - #if 0 /* not used yet */ /** * Returns the number of 4-component registers needed to store a piece @@ -410,7 +342,7 @@ _mesa_add_state_reference(struct gl_program_parameter_list *paramList, name = _mesa_program_state_string(stateTokens); index = _mesa_add_parameter(paramList, PROGRAM_STATE_VAR, name, size, GL_NONE, - NULL, (gl_state_index *) stateTokens, 0x0); + NULL, (gl_state_index *) stateTokens); paramList->StateFlags |= _mesa_program_state_flags(stateTokens); /* free name string here since we duplicated it in add_parameter() */ @@ -583,10 +515,9 @@ _mesa_clone_parameter_list(const struct gl_program_parameter_list *list) struct gl_program_parameter *pCopy; GLuint size = MIN2(p->Size, 4); GLint j = _mesa_add_parameter(clone, p->Type, p->Name, size, p->DataType, - list->ParameterValues[i], NULL, 0x0); + list->ParameterValues[i], NULL); ASSERT(j >= 0); pCopy = clone->Parameters + j; - pCopy->Flags = p->Flags; /* copy state indexes */ if (p->Type == PROGRAM_STATE_VAR) { GLint k; @@ -624,8 +555,7 @@ _mesa_combine_parameter_lists(const struct gl_program_parameter_list *listA, _mesa_add_parameter(list, param->Type, param->Name, param->Size, param->DataType, listB->ParameterValues[i], - param->StateIndexes, - param->Flags); + param->StateIndexes); } } } @@ -637,21 +567,3 @@ _mesa_combine_parameter_lists(const struct gl_program_parameter_list *listA, } return list; } - - -/** - * 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, - gl_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; -} |