From f4d3f916f1e424abdb86e086769b3b52233ac1c0 Mon Sep 17 00:00:00 2001 From: Danderaion <8724174+Danderaion@users.noreply.github.com> Date: Sun, 27 Feb 2022 15:09:50 +0200 Subject: [PATCH] Fix desire_api_version broken by previous commit --- src/VkBootstrap.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/VkBootstrap.cpp b/src/VkBootstrap.cpp index f331ad3..e3cfd3e 100644 --- a/src/VkBootstrap.cpp +++ b/src/VkBootstrap.cpp @@ -602,13 +602,9 @@ detail::Result InstanceBuilder::build() const { uint32_t api_version = instance_version < VKB_VK_API_VERSION_1_1 ? instance_version : info.required_api_version; - if (info.desired_api_version > VKB_VK_API_VERSION_1_0) { - if (instance_version > info.desired_api_version) { - instance_version = info.desired_api_version; - } - if (api_version > info.desired_api_version) { - api_version = info.desired_api_version; - } + if (info.desired_api_version > VKB_VK_API_VERSION_1_0 && instance_version >= info.desired_api_version) { + instance_version = info.desired_api_version; + api_version = info.desired_api_version; } VkApplicationInfo app_info = {};