glsl: make use glsl_type::is_atomic_uint()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 21 Apr 2017 08:16:58 +0000 (10:16 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 21 Apr 2017 17:33:29 +0000 (19:33 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
src/compiler/glsl/ast_to_hir.cpp
src/compiler/glsl/linker.cpp
src/compiler/glsl_types.h

index 9ea37f4cf62c10b25254effd4f3cdc188a6800ca..88fff861cc564681cc4058dcc6165f73a3a38406 100644 (file)
@@ -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.
              */
index 7ace01dd9d33756fc57a707bb97694d736dae562..4dcef2b260e2db93581031ddf0c03d45817d3ba4 100644 (file)
@@ -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 {
index 10a22aee0ac5b770605a0ed1fefa36964bb2f139..62af1496daabe5ee10ed0bdc8cdfc9cbf4a74e55 100644 (file)
@@ -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();