microsoft/compiler: Fix unhandled switch case warnings
authorJesse Natalie <jenatali@microsoft.com>
Sat, 28 Nov 2020 16:20:27 +0000 (08:20 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Dec 2020 17:10:47 +0000 (17:10 +0000)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7780>

src/microsoft/compiler/dxil_dump.c
src/microsoft/compiler/dxil_nir.c
src/microsoft/compiler/nir_to_dxil.c

index 46c702c7ba4d3f69abd0545693c0c9c1ee61ea87..69faa2d2b81f90204501a78eb7c1a7d022eece9d 100644 (file)
@@ -326,6 +326,7 @@ dump_attr_set_list(struct dxil_dumper *d, struct list_head *list)
          case DXIL_ATTR_KIND_NO_UNWIND: value = "nounwind"; break;
          case DXIL_ATTR_KIND_READ_NONE: value = "readnone"; break;
          case DXIL_ATTR_KIND_READ_ONLY: value = "readonly"; break;
+         case DXIL_ATTR_KIND_NO_DUPLICATE: value = "noduplicate"; break;
          }
          _mesa_string_buffer_append(d->buf, value);
       }
index 8c59fe8edc732ea8803d5e1f2cfe0b1c0d5d79eb..a9a7b324a68d0b39d31f3637e5089f55e0ff4a6e 100644 (file)
@@ -777,6 +777,8 @@ dxil_nir_lower_loads_stores_to_dxil(nir_shader *nir)
             case nir_intrinsic_store_ssbo:
                progress |= lower_store_ssbo(&b, intr);
                break;
+            default:
+               break;
             }
          }
       }
@@ -851,6 +853,8 @@ dxil_nir_lower_atomics_to_dxil(nir_shader *nir)
             ATOMIC(comp_swap);
 
 #undef ATOMIC
+            default:
+               break;
             }
          }
       }
@@ -1199,6 +1203,8 @@ lower_fp16_casts_filter(const nir_instr *instr, const void *data)
       case nir_op_f2f16_rtne:
       case nir_op_f2f16_rtz:
          return true;
+      default:
+         return false;
       }
    } else if (instr->type == nir_instr_type_intrinsic) {
       nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
@@ -1348,6 +1354,7 @@ lower_fp16_cast_impl(nir_builder *b, nir_instr *instr, void *data)
       case nir_op_f2f16_rtz:
          mode = nir_rounding_mode_rtz;
          break;
+      default: unreachable("Should've been filtered");
       }
    } else {
       nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
index 023f4d714fac33ceb109085ce1c7e61e1b09aa3d..ad063b65990fe65a690bfce061ef433057d129c6 100644 (file)
@@ -429,9 +429,9 @@ unary_func_name(enum dxil_intr intr)
    case DXIL_INTR_ISFINITE:
    case DXIL_INTR_ISNORMAL:
       return "dx.op.isSpecialFloat";
+   default:
+      return "dx.op.unary";
    }
-
-   return "dx.op.unary";
 }
 
 static const struct dxil_value *
@@ -1609,6 +1609,8 @@ emit_cast(struct ntd_context *ctx, nir_alu_instr *alu,
       if (is_double(info->input_types[0], nir_src_bit_size(alu->src[0].src)))
          ctx->mod.feats.dx11_1_double_extensions = true;
       break;
+   default:
+      break;
    }
 
    const struct dxil_value *v = dxil_emit_cast(&ctx->mod, opcode, type,
@@ -3591,6 +3593,10 @@ emit_tex(struct ntd_context *ctx, nir_tex_instr *instr)
       const struct dxil_value *retval = dxil_emit_extractval(&ctx->mod, sample, 3);
       store_dest(ctx, &instr->dest, 0, retval, nir_alu_type_get_base_type(instr->dest_type));
       return true;
+
+   default:
+      fprintf(stderr, "texture op: %d\n", instr->op);
+      unreachable("unknown texture op");
    }
 
    if (!sample)