summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-10-16 08:22:44 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-10-16 08:22:44 -0600
commit25af711e847935c626d977079aadad397b8e5585 (patch)
tree3210dfe9af0157673b88d129d26c8879ca4553b7
parentfae64a1bf6ca8c113fe8ef27cc441a0f19ace0de (diff)
mesa: fix error codes in _mesa_GetObjectParameterivARB(), bug 17861
-rw-r--r--src/mesa/main/shaders.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/mesa/main/shaders.c b/src/mesa/main/shaders.c
index f0db0d2a81..deababfac5 100644
--- a/src/mesa/main/shaders.c
+++ b/src/mesa/main/shaders.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 7.1
+ * Version: 7.2.1
*
* Copyright (C) 2004-2008 Brian Paul All Rights Reserved.
*
@@ -233,13 +233,23 @@ _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");
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectParameterivARB");
}
}