anv: Replace an assert() with unreachable()
authorJason Ekstrand <jason.ekstrand@collabora.com>
Fri, 1 Jul 2022 17:10:49 +0000 (12:10 -0500)
committerMarge Bot <emma+marge@anholt.net>
Wed, 6 Jul 2022 11:23:18 +0000 (11:23 +0000)
Also move it to the end of the switch as is more conventional.  For some
reason, later patches in the series make ANV fail to build because GCC
stops detecting the assert(!"str") as not returning.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17214>

src/intel/vulkan/anv_image.c

index 75840c3..1eef3a3 100644 (file)
@@ -2051,8 +2051,6 @@ anv_layout_to_aux_state(const struct intel_device_info * const devinfo,
          isl_drm_modifier_get_default_aux_state(image->vk.drm_format_mod);
 
       switch (aux_state) {
-      default:
-         assert(!"unexpected isl_aux_state");
       case ISL_AUX_STATE_AUX_INVALID:
          /* The modifier does not support compression. But, if we arrived
           * here, then we have enabled compression on it anyway, in which case
@@ -2070,6 +2068,8 @@ anv_layout_to_aux_state(const struct intel_device_info * const devinfo,
          return ISL_AUX_STATE_PASS_THROUGH;
       case ISL_AUX_STATE_COMPRESSED_NO_CLEAR:
          return ISL_AUX_STATE_COMPRESSED_NO_CLEAR;
+      default:
+         unreachable("unexpected isl_aux_state");
       }
    }