summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shader_query.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-08-17 15:44:48 -0700
committerIan Romanick <[email protected]>2011-10-04 13:17:46 -0700
commit7a80c1bbc56b61525634f2b699f995e863dfade2 (patch)
tree13fcca029ba289c4e33e27dfd5cf6928066cb4f9 /src/mesa/main/shader_query.cpp
parent523b611646ae15aa05ed37597ae9162de7290faf (diff)
mesa: Move _mesa_GetActiveAttribARB to shader_query.cpp
This just folds get_active_attrib into _mesa_GetActiveAttribARB and moves the resulting function function to the other source file. More changes are coming soon. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/shader_query.cpp')
-rw-r--r--src/mesa/main/shader_query.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index 424610d6d5a..6e81564f225 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -84,6 +84,38 @@ _mesa_BindAttribLocationARB(GLhandleARB program, GLuint index,
*/
}
+void GLAPIENTRY
+_mesa_GetActiveAttribARB(GLhandleARB program, GLuint index,
+ GLsizei maxLength, GLsizei * length, GLint * size,
+ GLenum * type, GLcharARB * name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ const struct gl_program_parameter_list *attribs = NULL;
+ struct gl_shader_program *shProg;
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveAttrib");
+ if (!shProg)
+ return;
+
+ if (shProg->VertexProgram)
+ attribs = shProg->VertexProgram->Base.Attributes;
+
+ if (!attribs || index >= attribs->NumParameters) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttrib(index)");
+ return;
+ }
+
+ _mesa_copy_string(name, maxLength, length,
+ attribs->Parameters[index].Name);
+
+ if (size)
+ *size = attribs->Parameters[index].Size
+ / _mesa_sizeof_glsl_type(attribs->Parameters[index].DataType);
+
+ if (type)
+ *type = attribs->Parameters[index].DataType;
+}
+
GLint GLAPIENTRY
_mesa_GetAttribLocationARB(GLhandleARB program, const GLcharARB * name)
{