[Mesa-dev] [PATCH] glsl: allow local_size qualifiers in compute shader regardless of version

Miklós Máté mtmkls at gmail.com
Fri Aug 26 17:39:40 UTC 2016


On 08/26/2016 06:46 PM, Ilia Mirkin wrote:
> On Fri, Aug 26, 2016 at 12:42 PM, Miklós Máté <mtmkls at gmail.com> wrote:
>> Tomb Raider 2013 uses #version 420 in compute shaders, and current Mesa
>> rejects them, because the local size qualifiers require 430.
>>
>> Signed-off-by: Miklós Máté <mtmkls at gmail.com>
>> ---
>>   src/compiler/glsl/glsl_parser.yy | 5 ++---
>>   1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy
>> index 4043dae..6857443 100644
>> --- a/src/compiler/glsl/glsl_parser.yy
>> +++ b/src/compiler/glsl/glsl_parser.yy
>> @@ -1615,10 +1615,9 @@ layout_qualifier_id:
>>         for (int i = 0; i < 3; i++) {
>>            if (match_layout_qualifier(local_size_qualifiers[i], $1,
>>                                       state) == 0) {
>> -            if (!state->has_compute_shader()) {
> IIRC this is the only use of ->has_compute_shader() so you could also
> remove that function. I sent a similar patch earlier that also removed
> the GL_ARB_compute_shader enable as it's not anywhere in the specs,
> but was told that a lot of people had stuck it in their shaders
> anyways, so I guess that bit has to stay.
>
> Chances are, though, that you want to go through and enable bits like
> shared memory, etc, not just the local_size. Have a look at
>
> https://patchwork.freedesktop.org/patch/107119/
>
> Feel free to respin it without the removal of the extension enable.
I think your patch is much more comprehensive, my patch only makes Tomb 
Raider happy. Without the removal of the enable bit, it looks good to me.

MM

>
>> +            if (state->stage != MESA_SHADER_COMPUTE) {
>>                  _mesa_glsl_error(& @3, state,
>> -                                "%s qualifier requires GLSL 4.30 or "
>> -                                "GLSL ES 3.10 or ARB_compute_shader",
>> +                                "%s qualifier is only allowed in compute shader",
>>                                   local_size_qualifiers[i]);
>>                  YYERROR;
>>               } else {
>> --
>> 2.9.3
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev




More information about the mesa-dev mailing list