diff options
author | Brian Paul <[email protected]> | 2010-05-26 22:40:38 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-05-26 22:40:38 -0600 |
commit | eb88c02a4bd4bee19a0e92b65653e64a078ea5c5 (patch) | |
tree | 5a98835957c283eb80b7c3449f8b85475eeca9de /src/mesa/shader | |
parent | 69861ae49724dd49ae3ba82398239ad892753de7 (diff) |
mesa: rewrite _mesa_get_handle() and add some comments
Diffstat (limited to 'src/mesa/shader')
-rw-r--r-- | src/mesa/shader/shader_api.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 25853823a1c..03fb1a91cef 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -893,21 +893,28 @@ _mesa_get_attached_shaders(GLcontext *ctx, GLuint program, GLsizei maxCount, } +/** glGetHandleARB() - return ID/name of currently bound shader program */ static GLuint _mesa_get_handle(GLcontext *ctx, GLenum pname) { - GLint handle = 0; - if (pname == GL_PROGRAM_OBJECT_ARB) { - CALL_GetIntegerv(ctx->Exec, (GL_CURRENT_PROGRAM, &handle)); - } else { + if (ctx->Shader.CurrentProgram) + return ctx->Shader.CurrentProgram->Name; + else + return 0; + } + else { _mesa_error(ctx, GL_INVALID_ENUM, "glGetHandleARB"); + return 0; } - - return handle; } +/** + * glGetProgramiv() - get shader program state. + * Note that this is for GLSL shader programs, not ARB vertex/fragment + * programs (see glGetProgramivARB). + */ static void _mesa_get_programiv(GLcontext *ctx, GLuint program, GLenum pname, GLint *params) @@ -977,6 +984,7 @@ _mesa_get_programiv(GLcontext *ctx, GLuint program, } +/** glGetShaderiv() - get GLSL shader state */ static void _mesa_get_shaderiv(GLcontext *ctx, GLuint name, GLenum pname, GLint *params) { |