get rid of STATE_USER_ATTRIB/STATE_AUTO_ATTRIB
authorBrian <brian@yutani.localnet.net>
Wed, 10 Jan 2007 02:26:22 +0000 (19:26 -0700)
committerBrian <brian@yutani.localnet.net>
Wed, 10 Jan 2007 02:26:22 +0000 (19:26 -0700)
src/mesa/shader/prog_parameter.c
src/mesa/shader/prog_statevars.h
src/mesa/shader/shader_api.c
src/mesa/shader/slang/slang_link2.c

index 8945f2d854c7059baa487ee7b2f586fe4d172952..900fb7e1a5c914d8ede82e8b0bb97b0999e8f68d 100644 (file)
@@ -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);
    }
index 47ef615f9bcfacac41b0b4e50a9eefdf36a40951..95e38ca7b6f92aa2979e0510553391f14a31b3a6 100644 (file)
@@ -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;
 
index 397ce916ea26548b100adec3fd1f0ffd41878445..101c6f1e7e3056df7ec8481f3aaf40e793119390 100644 (file)
@@ -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;
index da5ba5c2927612f4a41e9204536dd9ead8efe9d0..7dfdd288e12830a3bc21eefdc978d5724d869a49 100644 (file)
@@ -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);