summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-04-21 10:16:58 +0200
committerSamuel Pitoiset <[email protected]>2017-04-21 19:33:29 +0200
commit053912382ee2865da24be4bdd4c21de525519460 (patch)
tree19e54f7debbef458832635958a4f2bda7225ff73 /src
parent993a05f0eb4992a3608e54b607a07330b9fbe196 (diff)
glsl: make use glsl_type::is_atomic_uint()
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp5
-rw-r--r--src/compiler/glsl/linker.cpp3
-rw-r--r--src/compiler/glsl_types.h2
3 files changed, 4 insertions, 6 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 9ea37f4cf62..88fff861cc5 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -2633,8 +2633,7 @@ select_gles_precision(unsigned qual_precision,
* declare an atomic type with a different precision or to specify the
* default precision for an atomic type to be lowp or mediump."
*/
- if (type->base_type == GLSL_TYPE_ATOMIC_UINT &&
- precision != ast_precision_high) {
+ if (type->is_atomic_uint() && precision != ast_precision_high) {
_mesa_glsl_error(loc, state,
"atomic_uint can only have highp precision qualifier");
}
@@ -4735,7 +4734,7 @@ ast_declarator_list::hir(exec_list *instructions,
validate_array_dimensions(decl_type, state, &loc);
}
- if (decl_type->base_type == GLSL_TYPE_ATOMIC_UINT) {
+ if (decl_type->is_atomic_uint()) {
/* Empty atomic counter declarations are allowed and useful
* to set the default offset qualifier.
*/
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 7ace01dd9d3..4dcef2b260e 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -3702,8 +3702,7 @@ create_shader_variable(struct gl_shader_program *shProg,
* qualifier, except for vertex shader inputs and fragment shader
* outputs."
*/
- if (in->type->base_type == GLSL_TYPE_ATOMIC_UINT ||
- is_gl_identifier(in->name) ||
+ if (in->type->is_atomic_uint() || is_gl_identifier(in->name) ||
!(in->data.explicit_location || use_implicit_location)) {
out->location = -1;
} else {
diff --git a/src/compiler/glsl_types.h b/src/compiler/glsl_types.h
index 10a22aee0ac..62af1496daa 100644
--- a/src/compiler/glsl_types.h
+++ b/src/compiler/glsl_types.h
@@ -681,7 +681,7 @@ struct glsl_type {
*/
unsigned atomic_size() const
{
- if (base_type == GLSL_TYPE_ATOMIC_UINT)
+ if (is_atomic_uint())
return ATOMIC_COUNTER_SIZE;
else if (is_array())
return length * fields.array->atomic_size();