From 7256af0b3293b5a09bc860c3e0191d2b425936a1 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 25 Mar 2019 20:41:53 +0100 Subject: [PATCH] - fix sort bug --- src/rendering/vulkan/system/vk_device.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rendering/vulkan/system/vk_device.cpp b/src/rendering/vulkan/system/vk_device.cpp index 29693e56e..ede17b59b 100644 --- a/src/rendering/vulkan/system/vk_device.cpp +++ b/src/rendering/vulkan/system/vk_device.cpp @@ -185,8 +185,8 @@ void VulkanDevice::SelectPhysicalDevice() static const int typeSort[] = { 4, 1, 0, 2, 3 }; int sortA = a.device->Properties.deviceType < 5 ? typeSort[a.device->Properties.deviceType] : (int)a.device->Properties.deviceType; int sortB = b.device->Properties.deviceType < 5 ? typeSort[b.device->Properties.deviceType] : (int)b.device->Properties.deviceType; - if (sortA < sortB) - return true; + if (sortA != sortB) + return sortA < sortB; // Then sort by the device's unique ID so that vk_device uses a consistent order int sortUUID = memcmp(a.device->Properties.pipelineCacheUUID, b.device->Properties.pipelineCacheUUID, VK_UUID_SIZE);