mesa: GLES specifies restrictions on uniform matrix transpose.
authorOliver McFadden <oliver.mcfadden@linux.intel.com>
Mon, 7 May 2012 11:15:53 +0000 (14:15 +0300)
committerOliver McFadden <oliver.mcfadden@intel.com>
Mon, 14 May 2012 16:13:43 +0000 (19:13 +0300)
GL_INVALID_VALUE is generated if transpose is not GL_FALSE.

http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml

Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/uniform_query.cpp

index da41ee84c9c6daa84af104ac1d7c791a8d99f87a..08d330a52cb4f5f12a6b8153a4268d42b436e99e 100644 (file)
@@ -782,6 +782,16 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
       return;
    }
 
+   /* GL_INVALID_VALUE is generated if `transpose' is not GL_FALSE.
+    * http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml */
+   if (ctx->API == API_OPENGLES || ctx->API == API_OPENGLES2) {
+      if (transpose) {
+        _mesa_error(ctx, GL_INVALID_VALUE,
+                    "glUniformMatrix(matrix transpose is not GL_FALSE)");
+        return;
+      }
+   }
+
    if (ctx->Shader.Flags & GLSL_UNIFORMS) {
       log_uniform(values, GLSL_TYPE_FLOAT, components, vectors, count,
                  bool(transpose), shProg, location, uni);