summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2008-09-29 12:30:05 -0700
committerIan Romanick <ian.d.romanick@intel.com>2008-09-29 12:38:59 -0700
commita1688dc4a297d4afe1bd62b5f4ec6e1aa41a93ff (patch)
tree8c5520da8cc3e51ad97e68fe8f4c651bb51efc5f
parent41473ac9a0a2b3438451ed83fdfafe60fbfd1121 (diff)
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. (cherry picked from commit 3ab4b2066fd0b1493af38510e26e5a6ba83b5cf4)
-rw-r--r--src/mesa/main/shaders.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/main/shaders.c b/src/mesa/main/shaders.c
index f0db0d2a81..aeb5d4ca2a 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");