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

Ian Romanick idr at freedesktop.org
Fri Sep 30 12:32:13 PDT 2011


On 09/30/2011 12:18 PM, Ian Romanick wrote:
> On 09/29/2011 11:00 PM, Carl Worth wrote:
>> 2. if/if-arg-must-be-defined-02.frag
>
> Neither this test nor if-arg-must-be-defined-01 produce the desired
> result on NVIDIA's blob or AMD's blob. I'd be curious to know what it
> does on Apple's implementation.
>
> In any case, the test quotes specific language from the GLSL spec that
> explicitly forbids this behavior, so I'm somewhat reluctant to deviate
> from the spec'ed behavior.

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.


More information about the mesa-dev mailing list