[Mesa-dev] [PATCH] glsl: allow usage of the keyword buffer before GLSL 430 / ESSL 310

Ilia Mirkin imirkin at alum.mit.edu
Sun Apr 10 00:01:59 UTC 2016


On Sat, Apr 9, 2016 at 7:57 PM, Timothy Arceri
<timothy.arceri at collabora.com> wrote:
> On Sat, 2016-04-09 at 13:13 -0400, Ilia Mirkin wrote:
>> The GLSL 4.20 and ESSL 3.00 specs don't list 'buffer' as a reserved
>> keyword. Make the parser ignore it unless GLSL 4.30 / ESSL 3.10 are
>> used, or ARB_shader_storage_buffer_objects is enabled.
>>
>> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
>> Cc: mesa-stable at lists.freedesktop.org
>
> Seems right. Reviewed-by: Timothy Arceri <timothy.arceri at collabora.com>
>
> Does this fix a bug somewhere? Or just something you noticed?

Someone came into #nouveau asking why their shader didn't compile. I
suggested changing the var name as a short term fix, but figured I'd
fix it too.

>
>
>> ---
>>  src/compiler/glsl/glsl_lexer.ll | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/compiler/glsl/glsl_lexer.ll
>> b/src/compiler/glsl/glsl_lexer.ll
>> index 0b7695f..6b1ef17 100644
>> --- a/src/compiler/glsl/glsl_lexer.ll
>> +++ b/src/compiler/glsl/glsl_lexer.ll
>> @@ -304,7 +304,7 @@ in                return IN_TOK;
>>  out          return OUT_TOK;
>>  inout                return INOUT_TOK;
>>  uniform              return UNIFORM;
>> -buffer               return BUFFER;
>> +buffer               KEYWORD_WITH_ALT(0, 0, 430, 310, yyextra-
>> >ARB_shader_storage_buffer_object_enable, BUFFER);
>>  varying              DEPRECATED_ES_KEYWORD(VARYING);
>>  centroid     KEYWORD(120, 300, 120, 300, CENTROID);
>>  invariant    KEYWORD(120, 100, 120, 100, INVARIANT);


More information about the mesa-dev mailing list