glsl: Fix gl_shader_stage enum unsigned comparison
[mesa.git] / src / compiler / glsl / ast_to_hir.cpp
index 2dec8bbc32b7722079ab3e42e6d47f09e1676c50..e07e5f509b583b1137961580ad004d5123cfd89f 100644 (file)
@@ -3245,6 +3245,9 @@ apply_explicit_location(const struct ast_type_qualifier *qual,
                        "compute shader variables cannot be given "
                        "explicit locations");
       return;
+   default:
+      fail = true;
+      break;
    };
 
    if (fail) {
@@ -3276,7 +3279,7 @@ apply_explicit_location(const struct ast_type_qualifier *qual,
             ? (qual_location + FRAG_RESULT_DATA0)
             : (qual_location + VARYING_SLOT_VAR0);
          break;
-      case MESA_SHADER_COMPUTE:
+      default:
          assert(!"Unexpected shader type");
          break;
       }
@@ -4089,6 +4092,8 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
       case MESA_SHADER_COMPUTE:
          /* Invariance isn't meaningful in compute shaders. */
          break;
+      default:
+         break;
       }
    }
 
@@ -7402,9 +7407,10 @@ ast_process_struct_or_iface_block_members(exec_list *instructions,
          }
 
          /* Memory qualifiers are allowed on buffer and image variables, while
-          * the format qualifier is only accept for images.
+          * the format qualifier is only accepted for images.
           */
-         if (var_mode == ir_var_shader_storage || field_type->is_image()) {
+         if (var_mode == ir_var_shader_storage ||
+             field_type->without_array()->is_image()) {
             /* For readonly and writeonly qualifiers the field definition,
              * if set, overwrites the layout qualifier.
              */
@@ -7431,9 +7437,10 @@ ast_process_struct_or_iface_block_members(exec_list *instructions,
             fields[i].memory_restrict = qual->flags.q.restrict_flag ||
                                         (layout && layout->flags.q.restrict_flag);
 
-            if (field_type->is_image()) {
+            if (field_type->without_array()->is_image()) {
                if (qual->flags.q.explicit_image_format) {
-                  if (qual->image_base_type != field_type->sampled_type) {
+                  if (qual->image_base_type !=
+                      field_type->without_array()->sampled_type) {
                      _mesa_glsl_error(&loc, state, "format qualifier doesn't "
                                       "match the base data type of the image");
                   }