[Mesa-dev] [PATCH 18/23] mesa: Remove dead program_parameter::Flags field.
Kenneth Graunke
kenneth at whitecape.org
Sun Oct 14 17:43:18 PDT 2012
All flags are now gone, so we can stop storing and passing this around.
---
src/mesa/program/ir_to_mesa.cpp | 2 +-
src/mesa/program/prog_parameter.c | 23 +++++++++--------------
src/mesa/program/prog_parameter.h | 4 +---
src/mesa/program/program_parse.y | 2 +-
4 files changed, 12 insertions(+), 19 deletions(-)
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 4991a55..d5b9683 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2407,7 +2407,7 @@ add_uniform_to_shader::visit_field(const glsl_type *type, const char *name)
int index = _mesa_lookup_parameter_index(params, -1, name);
if (index < 0) {
index = _mesa_add_parameter(params, file, name, size, type->gl_type,
- NULL, NULL, 0x0);
+ NULL, NULL);
/* Sampler uniform values are stored in prog->SamplerUnits,
* and the entry in that array is selected by this index we
diff --git a/src/mesa/program/prog_parameter.c b/src/mesa/program/prog_parameter.c
index ed421b5..852af71 100644
--- a/src/mesa/program/prog_parameter.c
+++ b/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;
@@ -209,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);
}
@@ -261,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;
@@ -298,8 +296,7 @@ _mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList,
*/
GLint
_mesa_add_varying(struct gl_program_parameter_list *paramList,
- const char *name, GLuint size, GLenum datatype,
- GLbitfield flags)
+ const char *name, GLuint size, GLenum datatype)
{
GLint i = _mesa_lookup_parameter_index(paramList, -1, name);
if (i >= 0 && paramList->Parameters[i].Type == PROGRAM_VARYING) {
@@ -309,7 +306,7 @@ _mesa_add_varying(struct gl_program_parameter_list *paramList,
else {
/*assert(size == 4);*/
i = _mesa_add_parameter(paramList, PROGRAM_VARYING, name,
- size, datatype, NULL, NULL, flags);
+ size, datatype, NULL, NULL);
return i;
}
}
@@ -338,7 +335,7 @@ _mesa_add_attribute(struct gl_program_parameter_list *paramList,
if (size < 0)
size = 4;
i = _mesa_add_parameter(paramList, PROGRAM_INPUT, name,
- size, datatype, NULL, state, 0x0);
+ size, datatype, NULL, state);
}
return i;
}
@@ -396,7 +393,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() */
@@ -569,10 +566,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;
@@ -610,8 +606,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);
}
}
}
diff --git a/src/mesa/program/prog_parameter.h b/src/mesa/program/prog_parameter.h
index b12391f..2d98802 100644
--- a/src/mesa/program/prog_parameter.h
+++ b/src/mesa/program/prog_parameter.h
@@ -69,7 +69,6 @@ struct gl_program_parameter
*/
GLuint Size;
GLboolean Initialized; /**< debug: Has the ParameterValue[] been set? */
- GLbitfield Flags; /**< Bitmask of PROG_PARAM_*_BIT */
/**
* A sequence of STATE_* tokens and integers to identify GL state.
*/
@@ -118,8 +117,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]);
extern GLint
_mesa_add_named_constant(struct gl_program_parameter_list *paramList,
diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y
index 759c9ec..025b547 100644
--- a/src/mesa/program/program_parse.y
+++ b/src/mesa/program/program_parse.y
@@ -2473,7 +2473,7 @@ int add_state_reference(struct gl_program_parameter_list *param_list,
name = _mesa_program_state_string(tokens);
index = _mesa_add_parameter(param_list, PROGRAM_STATE_VAR, name,
- size, GL_NONE, NULL, tokens, 0x0);
+ size, GL_NONE, NULL, tokens);
param_list->StateFlags |= _mesa_program_state_flags(tokens);
/* free name string here since we duplicated it in add_parameter() */
--
1.7.12.2
More information about the mesa-dev
mailing list