mesa: glsl: fix error check in get_uniformfv()
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 6 Aug 2008 18:45:14 +0000 (12:45 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 6 Aug 2008 18:45:14 +0000 (12:45 -0600)
src/mesa/shader/shader_api.c

index 5c18e55dacf9afd11edb0bcb0f73e9011d3b5453..86b3d536e56faccc85f7e5a6f35ce9cac8e76eab 100644 (file)
 
 
 
+#ifndef GL_PROGRAM_BINARY_LENGTH_OES
+#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741
+#endif
+
+
 /**
  * Allocate a new gl_shader_program object, initialize it.
  */
@@ -906,6 +911,9 @@ _mesa_get_programiv(GLcontext *ctx, GLuint program,
       if (*params > 0)
          (*params)++;  /* add one for terminating zero */
       break;
+   case GL_PROGRAM_BINARY_LENGTH_OES:
+      *params = 0;
+      break;
    default:
       _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)");
       return;
@@ -999,7 +1007,7 @@ get_uniformfv(GLcontext *ctx, GLuint program, GLint location,
               GLfloat *params)
 {
    struct gl_shader_program *shProg
-      = _mesa_lookup_shader_program(ctx, program);
+      = _mesa_lookup_shader_program_err(ctx, program, "glGetUniform[if]v");
    if (shProg) {
       if (shProg->Uniforms &&
           location >= 0 && location < (GLint) shProg->Uniforms->NumUniforms) {
@@ -1033,9 +1041,6 @@ get_uniformfv(GLcontext *ctx, GLuint program, GLint location,
          _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(location)");
       }
    }
-   else {
-      _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(program)");
-   }
    return 0;
 }