Mesa (main): anv: Replace an assert() with unreachable()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 6 12:09:28 UTC 2022


Module: Mesa
Branch: main
Commit: 20016aa8f6fb877b6377ed3726ada81bc5169d5b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=20016aa8f6fb877b6377ed3726ada81bc5169d5b

Author: Jason Ekstrand <jason.ekstrand at collabora.com>
Date:   Fri Jul  1 12:10:49 2022 -0500

anv: Replace an assert() with unreachable()

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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 75840c3a5ac..1eef3a31149 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -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");
       }
    }
 



More information about the mesa-commit mailing list