summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2006-11-03 22:23:47 +0000
committerBrian Paul <[email protected]>2006-11-03 22:23:47 +0000
commitd2f80777e804742267efd700396275174928332d (patch)
tree73a54b9895a7d50fcff26f339d91ff4a9ffacc58 /src
parent3bef600024a27376680e1dab326c1dd22c562322 (diff)
implement _mesa_GetShaderiv()
Diffstat (limited to 'src')
-rw-r--r--src/mesa/shader/shaderobjects.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/mesa/shader/shaderobjects.c b/src/mesa/shader/shaderobjects.c
index fdcb92a215f..8265ff40e30 100644
--- a/src/mesa/shader/shaderobjects.c
+++ b/src/mesa/shader/shaderobjects.c
@@ -1013,7 +1013,7 @@ _mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params)
switch (pname) {
case GL_DELETE_STATUS:
- *params = 0; /* XXX fix */
+ *params = (**pro)._container._generic.GetDeleteStatus((struct gl2_generic_inf **) pro);
break;
case GL_LINK_STATUS:
*params = (**pro).GetLinkStatus(pro);
@@ -1055,7 +1055,35 @@ _mesa_GetProgramInfoLog(GLuint program, GLsizei bufSize,
void GLAPIENTRY
_mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params)
{
- /* XXX to do */
+ GET_CURRENT_CONTEXT(ctx);
+ GET_SHADER(sh, shader, "glGetShaderiv");
+
+ if (!sh)
+ return;
+
+ switch (pname) {
+ case GL_SHADER_TYPE:
+ *params = (**sh).GetSubType(sh);
+ break;
+ case GL_DELETE_STATUS:
+ *params = (**sh)._generic.GetDeleteStatus((struct gl2_generic_inf **) sh);
+ break;
+ case GL_COMPILE_STATUS:
+ *params = (**sh).GetCompileStatus(sh);
+ break;
+ case GL_INFO_LOG_LENGTH:
+ *params = (**sh)._generic.GetInfoLogLength((struct gl2_generic_inf **)sh);
+ break;
+ case GL_SHADER_SOURCE_LENGTH:
+ {
+ const GLchar *src = (**sh).GetSource(sh);
+ *params = src ? (_mesa_strlen(src) + 1) : 0;
+ }
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetShaderiv(pname)");
+ return;
+ }
}
void GLAPIENTRY