Mesa (master): mesa: glsl: fix error check in get_uniformfv()

Keith Whitwell keithw at kemper.freedesktop.org
Wed Sep 24 00:39:38 UTC 2008


Module: Mesa
Branch: master
Commit: bda6ad273d17efbe69a2a0599595cd4d50617cc3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bda6ad273d17efbe69a2a0599595cd4d50617cc3

Author: Brian Paul <brian.paul at tungstengraphics.com>
Date:   Wed Aug  6 12:45:14 2008 -0600

mesa: glsl: fix error check in get_uniformfv()
(cherry picked from commit 18cd9c229a1fc8da8b7669b8d1d100f6bbeca183)

---

 src/mesa/shader/shader_api.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index 161e8b6..6e13c72 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -50,6 +50,11 @@
 
 
 
+#ifndef GL_PROGRAM_BINARY_LENGTH_OES
+#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741
+#endif
+
+
 /**
  * Allocate a new gl_shader_program object, initialize it.
  */
@@ -929,6 +934,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;
@@ -1022,7 +1030,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) {
@@ -1056,9 +1064,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;
 }
 




More information about the mesa-commit mailing list