Re: [Mesa-dev] [PATCH] glsl: rename image_* qualifiers to memory_*
This is: Reviewed-by: Andres GomezOn Wed, 2017-05-03 at 11:16 +0200, Samuel Pitoiset wrote: > It doesn't make sense to prefix them with 'image' because > they are called "Memory Qualifiers" and they can be applied > to members of storage buffer blocks. > > Signed-off-by: Samuel Pitoiset > --- > src/compiler/glsl/ast_function.cpp | 10 +++--- > src/compiler/glsl/ast_to_hir.cpp | 54 > +++--- > src/compiler/glsl/builtin_functions.cpp| 30 - > src/compiler/glsl/builtin_variables.cpp| 10 +++--- > src/compiler/glsl/glsl_to_nir.cpp | 10 +++--- > src/compiler/glsl/ir.cpp | 20 +-- > src/compiler/glsl/ir.h | 12 +++ > src/compiler/glsl/link_uniforms.cpp| 4 +-- > src/compiler/glsl/lower_ubo_reference.cpp | 12 +++ > src/compiler/glsl_types.cpp| 20 +-- > src/compiler/glsl_types.h | 18 +- > src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 6 ++-- > 12 files changed, 103 insertions(+), 103 deletions(-) > > diff --git a/src/compiler/glsl/ast_function.cpp > b/src/compiler/glsl/ast_function.cpp > index 1b90937ec8..bee5f0588b 100644 > --- a/src/compiler/glsl/ast_function.cpp > +++ b/src/compiler/glsl/ast_function.cpp > @@ -107,35 +107,35 @@ verify_image_parameter(YYLTYPE *loc, > _mesa_glsl_parse_state *state, > * qualifiers. [...] It is legal to have additional qualifiers > * on a formal parameter, but not to have fewer." > */ > - if (actual->data.image_coherent && !formal->data.image_coherent) { > + if (actual->data.memory_coherent && !formal->data.memory_coherent) { >_mesa_glsl_error(loc, state, > "function call parameter `%s' drops " > "`coherent' qualifier", formal->name); >return false; > } > > - if (actual->data.image_volatile && !formal->data.image_volatile) { > + if (actual->data.memory_volatile && !formal->data.memory_volatile) { >_mesa_glsl_error(loc, state, > "function call parameter `%s' drops " > "`volatile' qualifier", formal->name); >return false; > } > > - if (actual->data.image_restrict && !formal->data.image_restrict) { > + if (actual->data.memory_restrict && !formal->data.memory_restrict) { >_mesa_glsl_error(loc, state, > "function call parameter `%s' drops " > "`restrict' qualifier", formal->name); >return false; > } > > - if (actual->data.image_read_only && !formal->data.image_read_only) { > + if (actual->data.memory_read_only && !formal->data.memory_read_only) { >_mesa_glsl_error(loc, state, > "function call parameter `%s' drops " > "`readonly' qualifier", formal->name); >return false; > } > > - if (actual->data.image_write_only && !formal->data.image_write_only) { > + if (actual->data.memory_write_only && !formal->data.memory_write_only) { >_mesa_glsl_error(loc, state, > "function call parameter `%s' drops " > "`writeonly' qualifier", formal->name); > diff --git a/src/compiler/glsl/ast_to_hir.cpp > b/src/compiler/glsl/ast_to_hir.cpp > index 20a0f11755..4cb62cdb23 100644 > --- a/src/compiler/glsl/ast_to_hir.cpp > +++ b/src/compiler/glsl/ast_to_hir.cpp > @@ -86,17 +86,17 @@ public: > return visit_continue; > >ir_variable *var = ir->variable_referenced(); > - /* We can have image_write_only set on both images and buffer > variables, > + /* We can have memory_write_only set on both images and buffer > variables, > * but in the former there is a distinction between reads from > * the variable itself (write_only) and from the memory they point to > - * (image_write_only), while in the case of buffer variables there is > + * (memory_write_only), while in the case of buffer variables there is > * no such distinction, that is why this check here is limited to > * buffer variables alone. > */ >if (!var || var->data.mode != ir_var_shader_storage) > return visit_continue; > > - if (var->data.image_write_only) { > + if (var->data.memory_write_only) { > found = var; > return visit_stop; >} > @@ -947,11 +947,11 @@ do_assignment(exec_list *instructions, struct > _mesa_glsl_parse_state *state, > error_emitted = true; >} else if (lhs_var != NULL && (lhs_var->data.read_only || > (lhs_var->data.mode == ir_var_shader_storage && > - lhs_var->data.image_read_only))) { > - /* We can have image_read_only set on both images and buffer > variables, > + lhs_var->data.memory_read_only))) { > +
[Mesa-dev] [PATCH] glsl: rename image_* qualifiers to memory_*
It doesn't make sense to prefix them with 'image' because they are called "Memory Qualifiers" and they can be applied to members of storage buffer blocks. Signed-off-by: Samuel Pitoiset--- src/compiler/glsl/ast_function.cpp | 10 +++--- src/compiler/glsl/ast_to_hir.cpp | 54 +++--- src/compiler/glsl/builtin_functions.cpp| 30 - src/compiler/glsl/builtin_variables.cpp| 10 +++--- src/compiler/glsl/glsl_to_nir.cpp | 10 +++--- src/compiler/glsl/ir.cpp | 20 +-- src/compiler/glsl/ir.h | 12 +++ src/compiler/glsl/link_uniforms.cpp| 4 +-- src/compiler/glsl/lower_ubo_reference.cpp | 12 +++ src/compiler/glsl_types.cpp| 20 +-- src/compiler/glsl_types.h | 18 +- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 6 ++-- 12 files changed, 103 insertions(+), 103 deletions(-) diff --git a/src/compiler/glsl/ast_function.cpp b/src/compiler/glsl/ast_function.cpp index 1b90937ec8..bee5f0588b 100644 --- a/src/compiler/glsl/ast_function.cpp +++ b/src/compiler/glsl/ast_function.cpp @@ -107,35 +107,35 @@ verify_image_parameter(YYLTYPE *loc, _mesa_glsl_parse_state *state, * qualifiers. [...] It is legal to have additional qualifiers * on a formal parameter, but not to have fewer." */ - if (actual->data.image_coherent && !formal->data.image_coherent) { + if (actual->data.memory_coherent && !formal->data.memory_coherent) { _mesa_glsl_error(loc, state, "function call parameter `%s' drops " "`coherent' qualifier", formal->name); return false; } - if (actual->data.image_volatile && !formal->data.image_volatile) { + if (actual->data.memory_volatile && !formal->data.memory_volatile) { _mesa_glsl_error(loc, state, "function call parameter `%s' drops " "`volatile' qualifier", formal->name); return false; } - if (actual->data.image_restrict && !formal->data.image_restrict) { + if (actual->data.memory_restrict && !formal->data.memory_restrict) { _mesa_glsl_error(loc, state, "function call parameter `%s' drops " "`restrict' qualifier", formal->name); return false; } - if (actual->data.image_read_only && !formal->data.image_read_only) { + if (actual->data.memory_read_only && !formal->data.memory_read_only) { _mesa_glsl_error(loc, state, "function call parameter `%s' drops " "`readonly' qualifier", formal->name); return false; } - if (actual->data.image_write_only && !formal->data.image_write_only) { + if (actual->data.memory_write_only && !formal->data.memory_write_only) { _mesa_glsl_error(loc, state, "function call parameter `%s' drops " "`writeonly' qualifier", formal->name); diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp index 20a0f11755..4cb62cdb23 100644 --- a/src/compiler/glsl/ast_to_hir.cpp +++ b/src/compiler/glsl/ast_to_hir.cpp @@ -86,17 +86,17 @@ public: return visit_continue; ir_variable *var = ir->variable_referenced(); - /* We can have image_write_only set on both images and buffer variables, + /* We can have memory_write_only set on both images and buffer variables, * but in the former there is a distinction between reads from * the variable itself (write_only) and from the memory they point to - * (image_write_only), while in the case of buffer variables there is + * (memory_write_only), while in the case of buffer variables there is * no such distinction, that is why this check here is limited to * buffer variables alone. */ if (!var || var->data.mode != ir_var_shader_storage) return visit_continue; - if (var->data.image_write_only) { + if (var->data.memory_write_only) { found = var; return visit_stop; } @@ -947,11 +947,11 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, error_emitted = true; } else if (lhs_var != NULL && (lhs_var->data.read_only || (lhs_var->data.mode == ir_var_shader_storage && - lhs_var->data.image_read_only))) { - /* We can have image_read_only set on both images and buffer variables, + lhs_var->data.memory_read_only))) { + /* We can have memory_read_only set on both images and buffer variables, * but in the former there is a distinction between assignments to * the variable itself (read_only) and to the memory they point to - * (image_read_only), while in the case of buffer variables there is + *