[Piglit] glsl-const-builtin-*: Fix GLSL compilation errors on Mac OS X.

Brian Paul brianp at vmware.com
Thu Jul 15 15:09:42 PDT 2010

On 07/15/2010 12:54 PM, Ian Romanick wrote:
> Hash: SHA1
> I believe that commit 14277414 is not correct.  As far as I can tell, in
> GLSL 1.20 the call 'acos(1)' should automatically convert the int(1) to
> float(1.0).  Page 20 (26 of the PDF) of the GLSL 1.20 spec lists an
> implicit conversion for int->float.  Page 43 (49 of the PDF) says:
>      "Otherwise, if no exact match is found, then the implicit
>      conversions in Section 4.1.10 “Implicit Conversions” will
>      be applied to the calling arguments if this can make their
>      types match a signature."
> If Apple's compiler doesn't compile this code, then it's a bug in their
> compiler.

BTW, IIRC, GLSL-ES does not allow implicit casts of ints to floats.  I 
remember running into this in the past when I was working on OpenGL ES 
support in the slang compiler and running the ES conformance tests.

OK, I just double-checked the ES 1.00 spec.  The 3rd paragraph of 
chapter 4 says:

User-defined types may be defined using struct to aggregate a list of 
existing types into a single name.
The OpenGL ES Shading Language is type safe. There are no implicit 
conversions between types.

That was a PITA to enforce.


More information about the Piglit mailing list