From c9365b7ca4fe7ac7e7e56debe50b371c8ed721d6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 3 Nov 2006 23:32:30 +0000 Subject: Fix _mesa_IsProgram() and _mesa_IsShader() --- src/mesa/shader/shaderobjects.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/shaderobjects.c b/src/mesa/shader/shaderobjects.c index 8265ff40e30..a2416c28726 100644 --- a/src/mesa/shader/shaderobjects.c +++ b/src/mesa/shader/shaderobjects.c @@ -1097,16 +1097,28 @@ GLboolean GLAPIENTRY _mesa_IsProgram(GLuint program) { GET_CURRENT_CONTEXT(ctx); - GET_GENERIC(gen, program, "glIsProgram"); - return gen ? GL_TRUE : GL_FALSE; + GET_PROGRAM(pro, program, "glIsProgram"); + if (pro) { + RELEASE_PROGRAM(pro); + return GL_TRUE; + } + else { + return GL_FALSE; + } } GLboolean GLAPIENTRY _mesa_IsShader(GLuint shader) { GET_CURRENT_CONTEXT(ctx); - GET_GENERIC(gen, shader, "glIsProgram"); - return gen ? GL_TRUE : GL_FALSE; + GET_SHADER(sh, shader, "glIsProgram"); + if (sh) { + RELEASE_SHADER(sh); + return GL_TRUE; + } + else { + return GL_FALSE; + } } -- cgit v1.2.3