From 8976d8280ff45cd7f947524a23fc70223967d7ca Mon Sep 17 00:00:00 2001 From: Oleksii Bozhenko Date: Wed, 12 Apr 2023 12:53:54 +0300 Subject: [PATCH] wsi: remove get_sorted_vk_formats duplication MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/commit/37a8b2d12ea97775b725172d1f89c1bd59fc98cf Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8727 Signed-off-by: Oleksii Bozhenko oleksii.bozhenko@globallogic.com Reviewed-by: Alejandro Piñeiro Reviewed-by: Eric Engestrom Part-of: --- src/vulkan/wsi/wsi_common_x11.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index c7798c3..2ca68e5 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -827,10 +827,12 @@ get_sorted_vk_formats(VkIcdSurfaceBase *surface, struct wsi_device *wsi_device, } for (unsigned i = 0; i < ARRAY_SIZE(formats); i++) { - if (formats[i] == sorted_formats[0]) - continue; + for (unsigned j = 0; j < *count; j++) + if (formats[i] == sorted_formats[j]) + goto next_format; if (rgb_component_bits_are_equal(formats[i], visual)) sorted_formats[(*count)++] = formats[i]; +next_format:; } if (wsi_device->force_bgra8_unorm_first) { -- 2.7.4