aurora: Fix device selection logic

This commit is contained in:
Luke Street 2022-06-13 19:23:37 -04:00
parent 3abaf6b734
commit e1d2ff7f2d
1 changed files with 1 additions and 4 deletions

View File

@ -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 typeItA = std::find(PreferredTypeOrder.begin(), PreferredTypeOrder.end(), propertiesA.adapterType);
const auto typeItB = std::find(PreferredTypeOrder.begin(), PreferredTypeOrder.end(), propertiesB.adapterType); const auto typeItB = std::find(PreferredTypeOrder.begin(), PreferredTypeOrder.end(), propertiesB.adapterType);
if (typeItA == PreferredTypeOrder.end() && typeItB != PreferredTypeOrder.end()) { return typeItA < typeItB;
return -1;
}
return static_cast<int>(typeItA - typeItB);
}); });
const auto adapterIt = std::find_if(adapters.begin(), adapters.end(), [=](const auto& adapter) -> bool { const auto adapterIt = std::find_if(adapters.begin(), adapters.end(), [=](const auto& adapter) -> bool {
wgpu::AdapterProperties properties; wgpu::AdapterProperties properties;