mesa: Allow setting GL_TEXTURE_MAX_LEVEL to 0 with GL_TEXTURE_RECTANGLE.
[mesa.git] / src / mesa / main / shader_query.cpp
index 02a48ba60a65a08ceab460abefb1b6f30bde5d89..e1afe5315f4e5c6f373799e8d588fd57ba753ac1 100644 (file)
@@ -40,7 +40,7 @@ extern "C" {
 }
 
 void GLAPIENTRY
-_mesa_BindAttribLocationARB(GLhandleARB program, GLuint index,
+_mesa_BindAttribLocation(GLhandleARB program, GLuint index,
                             const GLcharARB *name)
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -59,7 +59,7 @@ _mesa_BindAttribLocationARB(GLhandleARB program, GLuint index,
       return;
    }
 
-   if (index >= ctx->Const.VertexProgram.MaxAttribs) {
+   if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
       _mesa_error(ctx, GL_INVALID_VALUE, "glBindAttribLocation(index)");
       return;
    }
@@ -77,7 +77,7 @@ _mesa_BindAttribLocationARB(GLhandleARB program, GLuint index,
 }
 
 void GLAPIENTRY
-_mesa_GetActiveAttribARB(GLhandleARB program, GLuint desired_index,
+_mesa_GetActiveAttrib(GLhandleARB program, GLuint desired_index,
                          GLsizei maxLength, GLsizei * length, GLint * size,
                          GLenum * type, GLcharARB * name)
 {
@@ -106,8 +106,8 @@ _mesa_GetActiveAttribARB(GLhandleARB program, GLuint desired_index,
       const ir_variable *const var = ((ir_instruction *) node)->as_variable();
 
       if (var == NULL
-         || var->mode != ir_var_in
-         || var->location == -1)
+         || var->data.mode != ir_var_shader_in
+         || var->data.location == -1)
         continue;
 
       if (current_index == desired_index) {
@@ -132,7 +132,7 @@ _mesa_GetActiveAttribARB(GLhandleARB program, GLuint desired_index,
 }
 
 GLint GLAPIENTRY
-_mesa_GetAttribLocationARB(GLhandleARB program, const GLcharARB * name)
+_mesa_GetAttribLocation(GLhandleARB program, const GLcharARB * name)
 {
    GET_CURRENT_CONTEXT(ctx);
    struct gl_shader_program *const shProg =
@@ -169,13 +169,13 @@ _mesa_GetAttribLocationARB(GLhandleARB program, const GLcharARB * name)
        *     attribute, or if an error occurs, -1 will be returned."
        */
       if (var == NULL
-         || var->mode != ir_var_in
-         || var->location == -1
-         || var->location < VERT_ATTRIB_GENERIC0)
+         || var->data.mode != ir_var_shader_in
+         || var->data.location == -1
+         || var->data.location < VERT_ATTRIB_GENERIC0)
         continue;
 
       if (strcmp(var->name, name) == 0)
-        return var->location - VERT_ATTRIB_GENERIC0;
+        return var->data.location - VERT_ATTRIB_GENERIC0;
    }
 
    return -1;
@@ -197,8 +197,8 @@ _mesa_count_active_attribs(struct gl_shader_program *shProg)
       const ir_variable *const var = ((ir_instruction *) node)->as_variable();
 
       if (var == NULL
-         || var->mode != ir_var_in
-         || var->location == -1)
+         || var->data.mode != ir_var_shader_in
+         || var->data.location == -1)
         continue;
 
       i++;
@@ -223,8 +223,8 @@ _mesa_longest_attribute_name_length(struct gl_shader_program *shProg)
       const ir_variable *const var = ((ir_instruction *) node)->as_variable();
 
       if (var == NULL
-         || var->mode != ir_var_in
-         || var->location == -1)
+         || var->data.mode != ir_var_shader_in
+         || var->data.location == -1)
         continue;
 
       const size_t len = strlen(var->name);
@@ -333,13 +333,13 @@ _mesa_GetFragDataIndex(GLuint program, const GLchar *name)
        *     attribute, or if an error occurs, -1 will be returned."
        */
       if (var == NULL
-          || var->mode != ir_var_out
-          || var->location == -1
-          || var->location < FRAG_RESULT_DATA0)
+          || var->data.mode != ir_var_shader_out
+          || var->data.location == -1
+          || var->data.location < FRAG_RESULT_DATA0)
          continue;
 
       if (strcmp(var->name, name) == 0)
-         return var->index;
+         return var->data.index;
    }
 
    return -1;
@@ -389,13 +389,13 @@ _mesa_GetFragDataLocation(GLuint program, const GLchar *name)
        *     attribute, or if an error occurs, -1 will be returned."
        */
       if (var == NULL
-         || var->mode != ir_var_out
-         || var->location == -1
-         || var->location < FRAG_RESULT_DATA0)
+         || var->data.mode != ir_var_shader_out
+         || var->data.location == -1
+         || var->data.location < FRAG_RESULT_DATA0)
         continue;
 
       if (strcmp(var->name, name) == 0)
-        return var->location - FRAG_RESULT_DATA0;
+        return var->data.location - FRAG_RESULT_DATA0;
    }
 
    return -1;