summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-05-03 11:16:57 +0200
committerSamuel Pitoiset <[email protected]>2017-05-04 09:51:25 +0200
commita5f82db3805ff8e96b04e5b35fc566eac2f0a0a8 (patch)
tree5bc7b6872edf8c11d128b328b2354b9cba5dc014 /src/compiler/glsl
parentb546c9d318731b988aa3d8c4e4735cdbb596cfbf (diff)
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 <[email protected]> Reviewed-by: Andres Gomez <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/ast_function.cpp10
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp54
-rw-r--r--src/compiler/glsl/builtin_functions.cpp30
-rw-r--r--src/compiler/glsl/builtin_variables.cpp10
-rw-r--r--src/compiler/glsl/glsl_to_nir.cpp10
-rw-r--r--src/compiler/glsl/ir.cpp20
-rw-r--r--src/compiler/glsl/ir.h12
-rw-r--r--src/compiler/glsl/link_uniforms.cpp4
-rw-r--r--src/compiler/glsl/lower_ubo_reference.cpp12
9 files changed, 81 insertions, 81 deletions
diff --git a/src/compiler/glsl/ast_function.cpp b/src/compiler/glsl/ast_function.cpp
index 1b90937ec8c..bee5f0588b2 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 0703ed664c8..b57d1cf53b5 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
+ * (memory_read_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.
*/
@@ -3335,11 +3335,11 @@ apply_image_qualifier_to_variable(const struct ast_type_qualifier *qual,
"global variables");
}
- var->data.image_read_only |= qual->flags.q.read_only;
- var->data.image_write_only |= qual->flags.q.write_only;
- var->data.image_coherent |= qual->flags.q.coherent;
- var->data.image_volatile |= qual->flags.q._volatile;
- var->data.image_restrict |= qual->flags.q.restrict_flag;
+ var->data.memory_read_only |= qual->flags.q.read_only;
+ var->data.memory_write_only |= qual->flags.q.write_only;
+ var->data.memory_coherent |= qual->flags.q.coherent;
+ var->data.memory_volatile |= qual->flags.q._volatile;
+ var->data.memory_restrict |= qual->flags.q.restrict_flag;
var->data.read_only = true;
if (qual->flags.q.explicit_image_format) {
@@ -3377,8 +3377,8 @@ apply_image_qualifier_to_variable(const struct ast_type_qualifier *qual,
var->data.image_format != GL_R32F &&
var->data.image_format != GL_R32I &&
var->data.image_format != GL_R32UI &&
- !var->data.image_read_only &&
- !var->data.image_write_only) {
+ !var->data.memory_read_only &&
+ !var->data.memory_write_only) {
_mesa_glsl_error(loc, state, "image variables of format other than r32f, "
"r32i or r32ui must be qualified `readonly' or "
"`writeonly'");
@@ -7126,24 +7126,24 @@ ast_process_struct_or_iface_block_members(exec_list *instructions,
* if set, overwrites the layout qualifier.
*/
if (qual->flags.q.read_only) {
- fields[i].image_read_only = true;
- fields[i].image_write_only = false;
+ fields[i].memory_read_only = true;
+ fields[i].memory_write_only = false;
} else if (qual->flags.q.write_only) {
- fields[i].image_read_only = false;
- fields[i].image_write_only = true;
+ fields[i].memory_read_only = false;
+ fields[i].memory_write_only = true;
} else {
- fields[i].image_read_only = layout->flags.q.read_only;
- fields[i].image_write_only = layout->flags.q.write_only;
+ fields[i].memory_read_only = layout->flags.q.read_only;
+ fields[i].memory_write_only = layout->flags.q.write_only;
}
/* For other qualifiers, we set the flag if either the layout
* qualifier or the field qualifier are set
*/
- fields[i].image_coherent = qual->flags.q.coherent ||
+ fields[i].memory_coherent = qual->flags.q.coherent ||
layout->flags.q.coherent;
- fields[i].image_volatile = qual->flags.q._volatile ||
+ fields[i].memory_volatile = qual->flags.q._volatile ||
layout->flags.q._volatile;
- fields[i].image_restrict = qual->flags.q.restrict_flag ||
+ fields[i].memory_restrict = qual->flags.q.restrict_flag ||
layout->flags.q.restrict_flag;
}
@@ -7268,11 +7268,11 @@ is_unsized_array_last_element(ir_variable *v)
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;
+ var->data.memory_read_only = field.memory_read_only;
+ var->data.memory_write_only = field.memory_write_only;
+ var->data.memory_coherent = field.memory_coherent;
+ var->data.memory_volatile = field.memory_volatile;
+ var->data.memory_restrict = field.memory_restrict;
}
ir_rvalue *
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp
index 3abbb0c9f2a..cc1432197b9 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -5929,11 +5929,11 @@ builtin_builder::_image_prototype(const glsl_type *image_type,
* accept everything that needs to be accepted, and reject cases
* like loads from write-only or stores to read-only images.
*/
- image->data.image_read_only = (flags & IMAGE_FUNCTION_READ_ONLY) != 0;
- image->data.image_write_only = (flags & IMAGE_FUNCTION_WRITE_ONLY) != 0;
- image->data.image_coherent = true;
- image->data.image_volatile = true;
- image->data.image_restrict = true;
+ image->data.memory_read_only = (flags & IMAGE_FUNCTION_READ_ONLY) != 0;
+ image->data.memory_write_only = (flags & IMAGE_FUNCTION_WRITE_ONLY) != 0;
+ image->data.memory_coherent = true;
+ image->data.memory_volatile = true;
+ image->data.memory_restrict = true;
return sig;
}
@@ -5969,11 +5969,11 @@ builtin_builder::_image_size_prototype(const glsl_type *image_type,
* accept everything that needs to be accepted, and reject cases
* like loads from write-only or stores to read-only images.
*/
- image->data.image_read_only = true;
- image->data.image_write_only = true;
- image->data.image_coherent = true;
- image->data.image_volatile = true;
- image->data.image_restrict = true;
+ image->data.memory_read_only = true;
+ image->data.memory_write_only = true;
+ image->data.memory_coherent = true;
+ image->data.memory_volatile = true;
+ image->data.memory_restrict = true;
return sig;
}
@@ -5994,11 +5994,11 @@ builtin_builder::_image_samples_prototype(const glsl_type *image_type,
* accept everything that needs to be accepted, and reject cases
* like loads from write-only or stores to read-only images.
*/
- image->data.image_read_only = true;
- image->data.image_write_only = true;
- image->data.image_coherent = true;
- image->data.image_volatile = true;
- image->data.image_restrict = true;
+ image->data.memory_read_only = true;
+ image->data.memory_write_only = true;
+ image->data.memory_coherent = true;
+ image->data.memory_volatile = true;
+ image->data.memory_restrict = true;
return sig;
}
diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp
index c232571f26e..a45c9d62c71 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -336,11 +336,11 @@ per_vertex_accumulator::add_field(int slot, const glsl_type *type,
this->fields[this->num_fields].sample = 0;
this->fields[this->num_fields].patch = 0;
this->fields[this->num_fields].precision = GLSL_PRECISION_NONE;
- this->fields[this->num_fields].image_read_only = 0;
- this->fields[this->num_fields].image_write_only = 0;
- this->fields[this->num_fields].image_coherent = 0;
- this->fields[this->num_fields].image_volatile = 0;
- this->fields[this->num_fields].image_restrict = 0;
+ this->fields[this->num_fields].memory_read_only = 0;
+ this->fields[this->num_fields].memory_write_only = 0;
+ this->fields[this->num_fields].memory_coherent = 0;
+ this->fields[this->num_fields].memory_volatile = 0;
+ this->fields[this->num_fields].memory_restrict = 0;
this->fields[this->num_fields].explicit_xfb_buffer = 0;
this->fields[this->num_fields].xfb_buffer = -1;
this->fields[this->num_fields].xfb_stride = -1;
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp
index 189eb24ac61..307276555ee 100644
--- a/src/compiler/glsl/glsl_to_nir.cpp
+++ b/src/compiler/glsl/glsl_to_nir.cpp
@@ -426,11 +426,11 @@ nir_visitor::visit(ir_variable *ir)
var->data.index = ir->data.index;
var->data.binding = ir->data.binding;
var->data.offset = ir->data.offset;
- var->data.image.read_only = ir->data.image_read_only;
- var->data.image.write_only = ir->data.image_write_only;
- var->data.image.coherent = ir->data.image_coherent;
- var->data.image._volatile = ir->data.image_volatile;
- var->data.image.restrict_flag = ir->data.image_restrict;
+ var->data.image.read_only = ir->data.memory_read_only;
+ var->data.image.write_only = ir->data.memory_write_only;
+ var->data.image.coherent = ir->data.memory_coherent;
+ var->data.image._volatile = ir->data.memory_volatile;
+ var->data.image.restrict_flag = ir->data.memory_restrict;
var->data.image.format = ir->data.image_format;
var->data.fb_fetch_output = ir->data.fb_fetch_output;
diff --git a/src/compiler/glsl/ir.cpp b/src/compiler/glsl/ir.cpp
index 356eb0fbcfd..6a8b7904934 100644
--- a/src/compiler/glsl/ir.cpp
+++ b/src/compiler/glsl/ir.cpp
@@ -1722,11 +1722,11 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name,
this->data.max_array_access = -1;
this->data.offset = 0;
this->data.precision = GLSL_PRECISION_NONE;
- this->data.image_read_only = false;
- this->data.image_write_only = false;
- this->data.image_coherent = false;
- this->data.image_volatile = false;
- this->data.image_restrict = false;
+ this->data.memory_read_only = false;
+ this->data.memory_write_only = false;
+ this->data.memory_coherent = false;
+ this->data.memory_volatile = false;
+ this->data.memory_restrict = false;
this->data.from_ssbo_unsized_array = false;
this->data.fb_fetch_output = false;
@@ -1846,11 +1846,11 @@ ir_function_signature::qualifiers_match(exec_list *params)
a->data.centroid != b->data.centroid ||
a->data.sample != b->data.sample ||
a->data.patch != b->data.patch ||
- a->data.image_read_only != b->data.image_read_only ||
- a->data.image_write_only != b->data.image_write_only ||
- a->data.image_coherent != b->data.image_coherent ||
- a->data.image_volatile != b->data.image_volatile ||
- a->data.image_restrict != b->data.image_restrict) {
+ a->data.memory_read_only != b->data.memory_read_only ||
+ a->data.memory_write_only != b->data.memory_write_only ||
+ a->data.memory_coherent != b->data.memory_coherent ||
+ a->data.memory_volatile != b->data.memory_volatile ||
+ a->data.memory_restrict != b->data.memory_restrict) {
/* parameter a's qualifiers don't match */
return a->name;
diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h
index 9ab4df7219e..5a5729cdbe3 100644
--- a/src/compiler/glsl/ir.h
+++ b/src/compiler/glsl/ir.h
@@ -827,13 +827,13 @@ public:
ir_depth_layout depth_layout:3;
/**
- * ARB_shader_image_load_store qualifiers.
+ * Memory qualifiers.
*/
- unsigned image_read_only:1; /**< "readonly" qualifier. */
- unsigned image_write_only:1; /**< "writeonly" qualifier. */
- unsigned image_coherent:1;
- unsigned image_volatile:1;
- unsigned image_restrict:1;
+ unsigned memory_read_only:1; /**< "readonly" qualifier. */
+ unsigned memory_write_only:1; /**< "writeonly" qualifier. */
+ unsigned memory_coherent:1;
+ unsigned memory_volatile:1;
+ unsigned memory_restrict:1;
/**
* ARB_shader_storage_buffer_object
diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp
index f1e0885fbd3..c195e767e25 100644
--- a/src/compiler/glsl/link_uniforms.cpp
+++ b/src/compiler/glsl/link_uniforms.cpp
@@ -586,8 +586,8 @@ private:
/* Set image access qualifiers */
const GLenum access =
- (current_var->data.image_read_only ? GL_READ_ONLY :
- current_var->data.image_write_only ? GL_WRITE_ONLY :
+ (current_var->data.memory_read_only ? GL_READ_ONLY :
+ current_var->data.memory_write_only ? GL_WRITE_ONLY :
GL_READ_WRITE);
const unsigned first = this->next_image;
diff --git a/src/compiler/glsl/lower_ubo_reference.cpp b/src/compiler/glsl/lower_ubo_reference.cpp
index bfaddac3add..365b8ebc653 100644
--- a/src/compiler/glsl/lower_ubo_reference.cpp
+++ b/src/compiler/glsl/lower_ubo_reference.cpp
@@ -411,13 +411,13 @@ lower_ubo_reference_visitor::ssbo_access_params()
if (variable->is_interface_instance()) {
assert(struct_field);
- return ((struct_field->image_coherent ? ACCESS_COHERENT : 0) |
- (struct_field->image_restrict ? ACCESS_RESTRICT : 0) |
- (struct_field->image_volatile ? ACCESS_VOLATILE : 0));
+ return ((struct_field->memory_coherent ? ACCESS_COHERENT : 0) |
+ (struct_field->memory_restrict ? ACCESS_RESTRICT : 0) |
+ (struct_field->memory_volatile ? ACCESS_VOLATILE : 0));
} else {
- return ((variable->data.image_coherent ? ACCESS_COHERENT : 0) |
- (variable->data.image_restrict ? ACCESS_RESTRICT : 0) |
- (variable->data.image_volatile ? ACCESS_VOLATILE : 0));
+ return ((variable->data.memory_coherent ? ACCESS_COHERENT : 0) |
+ (variable->data.memory_restrict ? ACCESS_RESTRICT : 0) |
+ (variable->data.memory_volatile ? ACCESS_VOLATILE : 0));
}
}