[Mesa-dev] [PATCH 1/3] glsl: Apply memory qualifiers to vars inside named block interfaces
Eduardo Lima Mitev
elima at igalia.com
Tue May 10 04:27:14 UTC 2016
On 05/09/2016 08:46 PM, Ian Romanick wrote:
> Patches 1 and 2 are
>
Pushed 1 and 2.
> Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
>
> I don't have a strong opinion about patch 3, so I'll call that
>
> Acked-by: Ian Romanick <ian.d.romanick at intel.com>
>
I will hold on pushing 3 for the moment.
Thanks, Ian.
Eduardo
> On 05/05/2016 01:52 PM, Eduardo Lima Mitev wrote:
>> This is missing and memory qualifiers are currently being ignored for SSBOs.
>> ---
>> src/compiler/glsl/ast_to_hir.cpp | 22 +++++++++++++++-------
>> 1 file changed, 15 insertions(+), 7 deletions(-)
>>
>> diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
>> index c5cd48f..5a1fc9f 100644
>> --- a/src/compiler/glsl/ast_to_hir.cpp
>> +++ b/src/compiler/glsl/ast_to_hir.cpp
>> @@ -6963,6 +6963,16 @@ is_unsized_array_last_element(ir_variable *v)
>> return false;
>> }
>>
>> +static void
>> +apply_memory_qualifiers(ir_variable *var, glsl_struct_field field)
>> +{
>> + var->data.image_read_only = field.image_read_only;
>> + var->data.image_write_only = field.image_write_only;
>> + var->data.image_coherent = field.image_coherent;
>> + var->data.image_volatile = field.image_volatile;
>> + var->data.image_restrict = field.image_restrict;
>> +}
>> +
>> ir_rvalue *
>> ast_interface_block::hir(exec_list *instructions,
>> struct _mesa_glsl_parse_state *state)
>> @@ -7449,6 +7459,9 @@ ast_interface_block::hir(exec_list *instructions,
>> }
>> }
>> }
>> +
>> + if (var->data.mode == ir_var_shader_storage)
>> + apply_memory_qualifiers(var, fields[i]);
>> }
>>
>> if (ir_variable *earlier =
>> @@ -7523,13 +7536,8 @@ ast_interface_block::hir(exec_list *instructions,
>> var->data.matrix_layout = fields[i].matrix_layout;
>> }
>>
>> - if (var->data.mode == ir_var_shader_storage) {
>> - var->data.image_read_only = fields[i].image_read_only;
>> - var->data.image_write_only = fields[i].image_write_only;
>> - var->data.image_coherent = fields[i].image_coherent;
>> - var->data.image_volatile = fields[i].image_volatile;
>> - var->data.image_restrict = fields[i].image_restrict;
>> - }
>> + if (var->data.mode == ir_var_shader_storage)
>> + apply_memory_qualifiers(var, fields[i]);
>>
>> /* Examine var name here since var may get deleted in the next call */
>> bool var_is_gl_id = is_gl_identifier(var->name);
>>
>
>
More information about the mesa-dev
mailing list