From 3ab4b2066fd0b1493af38510e26e5a6ba83b5cf4 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 29 Sep 2008 12:30:05 -0700 Subject: [PATCH] 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. --- src/mesa/main/shaders.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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"); -- 2.30.2