diff options
author | Ian Romanick <[email protected]> | 2011-08-16 12:51:25 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2011-10-04 12:33:28 -0700 |
commit | b7fa0d0727a3a9e1f64d3cfc7a0f157b35dec09e (patch) | |
tree | 84d4cf73928dd54023863471f1a72e4be1b7e877 /src/mesa/main/shaderapi.c | |
parent | 7bbcc0b832b02f9da6365ec6a86a0167cf75d8a8 (diff) |
mesa: Move _mesa_GetAttribLocationARB to shader_query.cpp
This allows querying the linked shader itself rather than the Mesa IR.
This is the first step towards removing gl_program::Attributes.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderapi.c')
-rw-r--r-- | src/mesa/main/shaderapi.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 3ce14d15446..49e65e8cc6a 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -324,39 +324,6 @@ attach_shader(struct gl_context *ctx, GLuint program, GLuint shader) } -static GLint -get_attrib_location(struct gl_context *ctx, GLuint program, const GLchar *name) -{ - struct gl_shader_program *shProg - = _mesa_lookup_shader_program_err(ctx, program, "glGetAttribLocation"); - - if (!shProg) { - return -1; - } - - if (!shProg->LinkStatus) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetAttribLocation(program not linked)"); - return -1; - } - - if (!name) - return -1; - - if (shProg->VertexProgram) { - const struct gl_program_parameter_list *attribs = - shProg->VertexProgram->Base.Attributes; - if (attribs) { - GLint i = _mesa_lookup_parameter_index(attribs, -1, name); - if (i >= 0) { - return attribs->Parameters[i].StateIndexes[0]; - } - } - } - return -1; -} - - static void bind_attrib_location(struct gl_context *ctx, GLuint program, GLuint index, const GLchar *name) @@ -1316,14 +1283,6 @@ _mesa_GetAttachedShaders(GLuint program, GLsizei maxCount, } -GLint GLAPIENTRY -_mesa_GetAttribLocationARB(GLhandleARB program, const GLcharARB * name) -{ - GET_CURRENT_CONTEXT(ctx); - return get_attrib_location(ctx, program, name); -} - - /* GL_EXT_gpu_shader4, GL3 */ GLint GLAPIENTRY _mesa_GetFragDataLocation(GLuint program, const GLchar *name) |