summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-01-09 19:26:22 -0700
committerBrian <[email protected]>2007-01-09 19:26:22 -0700
commit01a91eb65753c9090e1a05d728cf5c23ef49d5d4 (patch)
tree66851c75ed1e7ebea6ce0e351000c9f1a01f4ae1 /src/mesa
parentb7978af6936d186112727cb9858fe7740eef1a7c (diff)
get rid of STATE_USER_ATTRIB/STATE_AUTO_ATTRIB
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/prog_parameter.c6
-rw-r--r--src/mesa/shader/prog_statevars.h2
-rw-r--r--src/mesa/shader/shader_api.c2
-rw-r--r--src/mesa/shader/slang/slang_link2.c8
4 files changed, 8 insertions, 10 deletions
diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c
index 8945f2d854c..900fb7e1a5c 100644
--- a/src/mesa/shader/prog_parameter.c
+++ b/src/mesa/shader/prog_parameter.c
@@ -289,16 +289,14 @@ _mesa_add_attribute(struct gl_program_parameter_list *paramList,
GLint i = _mesa_lookup_parameter_index(paramList, -1, name);
if (i >= 0) {
/* replace */
- ASSERT(paramList->Parameters[i].StateIndexes[0] == STATE_USER_ATTRIB);
if (attrib < 0)
attrib = i;
- paramList->Parameters[i].StateIndexes[1] = attrib;
+ paramList->Parameters[i].StateIndexes[0] = attrib;
}
else {
/* add */
gl_state_index state[STATE_LENGTH];
- state[0] = STATE_USER_ATTRIB;
- state[1] = attrib;
+ state[0] = attrib;
i = _mesa_add_parameter(paramList, PROGRAM_INPUT, name,
size, NULL, state);
}
diff --git a/src/mesa/shader/prog_statevars.h b/src/mesa/shader/prog_statevars.h
index 47ef615f9bc..95e38ca7b6f 100644
--- a/src/mesa/shader/prog_statevars.h
+++ b/src/mesa/shader/prog_statevars.h
@@ -103,8 +103,6 @@ typedef enum gl_state_index_ {
STATE_NORMAL_SCALE,
STATE_TEXRECT_SCALE,
STATE_POSITION_NORMALIZED, /* normalized light position */
- STATE_USER_ATTRIB, /** shader vertex attrib: user-specified */
- STATE_AUTO_ATTRIB, /** shader vertex attrib: linker-specified */
STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */
} gl_state_index;
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index 397ce916ea2..101c6f1e7e3 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -554,7 +554,7 @@ _mesa_get_attrib_location(GLcontext *ctx, GLuint program,
if (shProg->Attributes) {
GLint i = _mesa_lookup_parameter_index(shProg->Attributes, -1, name);
if (i >= 0) {
- return shProg->Attributes->Parameters[i].StateIndexes[1];
+ return shProg->Attributes->Parameters[i].StateIndexes[0];
}
}
return -1;
diff --git a/src/mesa/shader/slang/slang_link2.c b/src/mesa/shader/slang/slang_link2.c
index da5ba5c2927..7dfdd288e12 100644
--- a/src/mesa/shader/slang/slang_link2.c
+++ b/src/mesa/shader/slang/slang_link2.c
@@ -332,7 +332,7 @@ _slang_resolve_attributes(struct gl_shader_program *shProg,
*/
usedAttributes = 0x0;
for (i = 0; i < shProg->Attributes->NumParameters; i++) {
- GLint attr = shProg->Attributes->Parameters[i].StateIndexes[1];
+ GLint attr = shProg->Attributes->Parameters[i].StateIndexes[0];
usedAttributes |= attr;
}
@@ -358,7 +358,7 @@ _slang_resolve_attributes(struct gl_shader_program *shProg,
GLint attr;
if (index >= 0) {
/* found, user must have specified a binding */
- attr = shProg->Attributes->Parameters[index].StateIndexes[1];
+ attr = shProg->Attributes->Parameters[index].StateIndexes[0];
}
else {
/* not found, choose our own attribute number */
@@ -568,7 +568,9 @@ _slang_link2(GLcontext *ctx,
_slang_resolve_samplers(shProg, &shProg->VertexProgram->Base);
_slang_resolve_samplers(shProg, &shProg->FragmentProgram->Base);
- _slang_resolve_attributes(shProg, &shProg->VertexProgram->Base);
+ if (!_slang_resolve_attributes(shProg, &shProg->VertexProgram->Base)) {
+ /*goto cleanup;*/
+ }
_slang_update_inputs_outputs(&shProg->VertexProgram->Base);
_slang_update_inputs_outputs(&shProg->FragmentProgram->Base);