[Mesa-dev] [PATCH 1/2] mesa: GLES specifies restrictions on uniform matrix transpose.

Oliver McFadden oliver.mcfadden at linux.intel.com
Mon May 14 20:13:33 PDT 2012


On Mon, May 14, 2012 at 11:46:15AM -0700, Ian Romanick wrote:
> On 05/14/2012 04:56 AM, Oliver McFadden wrote:
> > 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 at linux.intel.com>
> > ---
> >   src/mesa/main/uniform_query.cpp |   10 ++++++++++
> >   1 files changed, 10 insertions(+), 0 deletions(-)
> >
> > diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
> > index da41ee8..e8bdab2 100644
> > --- a/src/mesa/main/uniform_query.cpp
> > +++ b/src/mesa/main/uniform_query.cpp
> > @@ -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 */
> 
> We usually do this sort of thing by quoting the text from the actual 
> spec.  I usually format these comments in a specific way to make it 
> easier to search for them in my editor. :)
> 
>      /* Page 37 (page 47 of the PDF) of the OpenGL ES 2.0.25 spec says:
>       *
>       *     "The matrix is specified in column-major order. transpose
>       *     must be FALSE."
>       */

OK, noted for future patches.  I do not have a hard-copy of the ES spec
so I can only include PDF page numbers.

I used the SDK man pages because they have a nice section listing all
the possible error conditions.  You're right though, the spec is the
authoritative reference.

> 
> > +   if (ctx->API == API_OPENGLES || ctx->API == API_OPENGLES2) {
> > +      if (bool(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);

-- 
Oliver McFadden.


More information about the mesa-dev mailing list