[Mesa-dev] [PATCH] glsl: allow standalone semicolons outside main()

Dave Airlie airlied at gmail.com
Thu Jun 14 00:20:03 UTC 2018


On 14 June 2018 at 10:12, Matt Turner <mattst88 at gmail.com> wrote:
> On Wed, Jun 13, 2018 at 4:53 PM, Dave Airlie <airlied at gmail.com> wrote:
>> From: Dave Airlie <airlied at redhat.com>
>>
>> GLSL 4.60 offically added this but games and older CTS suites actually
>> had shaders that did this, we may as well enable it everywhere.
>> ---
>>  src/compiler/glsl/glsl_parser.yy | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy
>> index 91c10ce1a60..432fc874268 100644
>> --- a/src/compiler/glsl/glsl_parser.yy
>> +++ b/src/compiler/glsl/glsl_parser.yy
>> @@ -2706,6 +2706,7 @@ external_declaration:
>>     | declaration            { $$ = $1; }
>>     | pragma_statement       { $$ = NULL; }
>>     | layout_defaults        { $$ = $1; }
>> +   | ';' { $$ = NULL; }
>
> Indentation.
>
> Also, piglit test?

There is already a piglit test, unfortunately it only runs under glsl 4.60,

I suppose I can send a patch to enable it to run from GLSL1.30.

>
> Reviewed-by: Matt Turner <mattst88 at gmail.com>
Thanks,
Dave.


More information about the mesa-dev mailing list