From e1d2ff7f2d42e9b5fea9e27a222bc017faf5a145 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 13 Jun 2022 19:23:37 -0400 Subject: [PATCH] aurora: Fix device selection logic --- aurora/lib/gpu.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/aurora/lib/gpu.cpp b/aurora/lib/gpu.cpp index 859d93d2c..62a931c66 100644 --- a/aurora/lib/gpu.cpp +++ b/aurora/lib/gpu.cpp @@ -268,10 +268,7 @@ bool initialize(SDL_Window* window, wgpu::BackendType backendType, uint32_t msaa }; const auto typeItA = std::find(PreferredTypeOrder.begin(), PreferredTypeOrder.end(), propertiesA.adapterType); const auto typeItB = std::find(PreferredTypeOrder.begin(), PreferredTypeOrder.end(), propertiesB.adapterType); - if (typeItA == PreferredTypeOrder.end() && typeItB != PreferredTypeOrder.end()) { - return -1; - } - return static_cast(typeItA - typeItB); + return typeItA < typeItB; }); const auto adapterIt = std::find_if(adapters.begin(), adapters.end(), [=](const auto& adapter) -> bool { wgpu::AdapterProperties properties;