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

Ilia Mirkin imirkin at alum.mit.edu
Fri Aug 26 17:47:09 UTC 2016


On Fri, Aug 26, 2016 at 1:39 PM, Miklós Máté <mtmkls at gmail.com> wrote:
> 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.

BTW, would I be correct in guessing that you have a IVB/Haswell, and
have applied the fp64 patches, but still don't have
GL_ARB_stencil_texturing and thus no GL 4.3? I'm pretty sure others
have been successful in running it on mesa.

  -ilia


More information about the mesa-dev mailing list