[Mesa-dev] [PATCH 1/2] glcpp: Check version_resolved in the proper place.

Matt Turner mattst88 at gmail.com
Mon Jan 27 15:18:26 PST 2014


On Mon, Jan 27, 2014 at 3:14 PM, Ian Romanick <idr at freedesktop.org> wrote:
> On 01/26/2014 07:14 PM, Matt Turner wrote:
>> The check was in the wrong place, such that if a shader incorrectly put
>> a preprocessor token before the #version declaration, the version would
>> be resolved twice, leading to a segmentation fault when attempting to
>> redefine the __VERSION__ macro.
>>
>>  #define GL_ARB_sample_shading
>>  #version 130
>>  void main() {}
>
> This is an invalid shader.  Segfaulting is bad, and fixing it is good.
> Is the compile error still generated?

Yeah, after fixing #define GL... -> #extension GL_... : require:

> Failed to compile fragment shader version.frag: 0:2(1): error: syntax error, unexpected VERSION_TOK


More information about the mesa-dev mailing list