[Mesa-dev] [PATCH] glsl: fix check SSBOs support for builtin functions

Samuel Iglesias Gonsálvez siglesias at igalia.com
Fri Oct 16 00:57:24 PDT 2015



On 16/10/15 09:36, Iago Toral wrote:
> On Fri, 2015-10-16 at 09:10 +0200, Samuel Iglesias Gonsalvez wrote:
>> has_shader_storage_buffer_objects() returns true also if the OpenGL
>> context is 4.30 or ES 3.1.
>>
>> Previously, we were saying that all atomic*() GLSL builtin functions
>> for SSBOs were not available when OpenGL ES 3.1 context was in use.
>>
>> Fixes 48 dEQP-GLES31 tests:
>>
>> dEQP-GLES31.functional.ssbo.atomic.*
> 
> Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
> 
> That said:
> 
>> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
>> ---
>>  src/glsl/builtin_functions.cpp | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp
>> index f0f6be2..aae25f8 100644
>> --- a/src/glsl/builtin_functions.cpp
>> +++ b/src/glsl/builtin_functions.cpp
>> @@ -403,7 +403,7 @@ shader_atomic_counters(const _mesa_glsl_parse_state *state)
>>  static bool
>>  shader_storage_buffer_object(const _mesa_glsl_parse_state *state)
>>  {
>> -   return state->ARB_shader_storage_buffer_object_enable;
> 
> shouldn't we set the above to true with GLES 3.1?
> 

ARB_shader_storage_buffer_object_enable is true when the driver supports
the ARB_shader_storage_buffer_object extension *and* we explicitly
enable the extension inside a GLSL (or GLSL ES) shader:

#extension ARB_shader_storage_buffer_object : enable

Same happens with ARB_shader_storage_buffer_object_warn. See
_mesa_glsl_supported_extensions[] in glsl_parser_extras.cpp for more
details.

When we are under OpenGL 4.3 (or higher) or OpenGL ES 3.1 (or higher)
context, we don't need to explicitly enable the extension in the GLSL
shader as it should be already supported by the driver. That second test
is done in has_shader_storage_buffer_objects().

Sam

>> +   return state->has_shader_storage_buffer_objects();
>>  }
>>  
>>  static bool
> 
> 
> 


More information about the mesa-dev mailing list