From: Brian Date: Wed, 10 Jan 2007 02:26:22 +0000 (-0700) Subject: get rid of STATE_USER_ATTRIB/STATE_AUTO_ATTRIB X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=01a91eb65753c9090e1a05d728cf5c23ef49d5d4;p=mesa.git get rid of STATE_USER_ATTRIB/STATE_AUTO_ATTRIB --- 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);