Module: Mesa Branch: main Commit: 54c7a245ca7a5326f7cb0790c8c63a4e61071341 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=54c7a245ca7a5326f7cb0790c8c63a4e61071341
Author: Erik Faye-Lund <[email protected]> Date: Wed Mar 23 18:34:26 2022 +0100 pvr: do not use fallthrough for unreachable code unreachable() doesn't lead to executing the code that follows it, neither in debug nor release builds. So falling through doesn't make any sense. This fixes a compile-error on clang. Let's move the default-block to the end to make it clearer that there's no intended fallthrough. Reviewed-by: Frank Binns <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15531> --- src/imagination/vulkan/pvr_cmd_buffer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/imagination/vulkan/pvr_cmd_buffer.c b/src/imagination/vulkan/pvr_cmd_buffer.c index 889947ce5d7..76bc0f35d63 100644 --- a/src/imagination/vulkan/pvr_cmd_buffer.c +++ b/src/imagination/vulkan/pvr_cmd_buffer.c @@ -4392,10 +4392,6 @@ static void pvr_emit_vdm_index_list(struct pvr_cmd_buffer *cmd_buffer, struct pvr_buffer *buffer = state->index_buffer_binding.buffer; switch (state->index_buffer_binding.type) { - default: - unreachable("Invalid index type"); - FALLTHROUGH; - case VK_INDEX_TYPE_UINT32: list0.index_size = PVRX(VDMCTRL_INDEX_SIZE_B32); index_stride = 4; @@ -4405,6 +4401,9 @@ static void pvr_emit_vdm_index_list(struct pvr_cmd_buffer *cmd_buffer, list0.index_size = PVRX(VDMCTRL_INDEX_SIZE_B16); index_stride = 2; break; + + default: + unreachable("Invalid index type"); } list0.index_addr_present = true;
