From: Ian Romanick Date: Mon, 29 Sep 2008 19:30:05 +0000 (-0700) Subject: GLSL: Implement GL_OBJECT_TYPE_ARB query X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3ab4b2066fd0b1493af38510e26e5a6ba83b5cf4;p=mesa.git GLSL: Implement GL_OBJECT_TYPE_ARB query The GL_OBJECT_TYPE_ARB query is handled directly in _mesa_GetObjectParamterivARB because it is only supported in the extension version of the shanding language API. glGetProgramiv and glGetShaderiv should not accept this enum. --- diff --git a/src/mesa/main/shaders.c b/src/mesa/main/shaders.c index f0db0d2a818..aeb5d4ca2ab 100644 --- a/src/mesa/main/shaders.c +++ b/src/mesa/main/shaders.c @@ -233,10 +233,18 @@ _mesa_GetObjectParameterivARB(GLhandleARB object, GLenum pname, GLint *params) GET_CURRENT_CONTEXT(ctx); /* Implement in terms of GetProgramiv, GetShaderiv */ if (ctx->Driver.IsProgram(ctx, object)) { - ctx->Driver.GetProgramiv(ctx, object, pname, params); + if (pname == GL_OBJECT_TYPE_ARB) { + *params = GL_PROGRAM_OBJECT_ARB; + } else { + ctx->Driver.GetProgramiv(ctx, object, pname, params); + } } else if (ctx->Driver.IsShader(ctx, object)) { - ctx->Driver.GetShaderiv(ctx, object, pname, params); + if (pname == GL_OBJECT_TYPE_ARB) { + *params = GL_SHADER_OBJECT_ARB; + } else { + ctx->Driver.GetShaderiv(ctx, object, pname, params); + } } else { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetObjectParameterivARB");