[Mesa-dev] A few fixes for the preprocessor for GLSL 1.30

Carl Worth cworth at cworth.org
Fri Feb 22 13:14:12 PST 2013


Ian Romanick <idr at freedesktop.org> writes:
> Though, it turns out that this deviates from what C99 specifies. 
> Specifically, the ISO/IEC 9899:TC2 Committee Draft dated May 6, 2005 says:
>
>      "After all replacements due to macro expansion and the defined unary
>      operator have been performed, all remaining identifiers are replaced
>      with the pp-number 0..."
>
> I've submitted a GLSL spec bug.
>
> In the mean time, I'd suggest leaving the tests and our implementation 
> as-is.

Hi Ian,

Back in September, 2011, I did leave the test and implementation as-is.

Then, in June 2012, I changed the behavior of our implementation, (I
believe this was in response to an upcoming change in the specification
you were aware of). At the time, I updated some "make check" tests, but
failed to update piglit, (leading to bugzilla bug #51631).

I'd like to fix that now. I can see by comparing the GLSL 4.30
specification to GLSL 1.30 that the following sentence has been dropped,
(justifying the currently implemented behavior in Mesa):

	It is an error to use #if or #elif on expressions containing
	undefined macro names, other than as arguments to the
	defined operator.

But I'd like a little guidance on what to do with the piglit test. We're
still only support GLSL 1.30 in our implementation, right? Should we be
supporting the formerly-specified behavior until we start seeing
"#version 430"?

Or should we change piglit to just check for the new behavior, even with
the old version? (You mentioned earlier in this thread that AMD and
nVidia binary blobs were previously implementing the new behavior
anyway).

-Carl

-- 
carl.d.worth at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130222/01c92611/attachment.pgp>


More information about the mesa-dev mailing list