From 26b1e2507728a2dafe7712cab609b78b677e1b7f Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Fri, 30 Sep 2016 12:40:06 -1000 Subject: [PATCH] Better branching logic for Vulkan init --- lib/x11/ApplicationXlib.hpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/x11/ApplicationXlib.hpp b/lib/x11/ApplicationXlib.hpp index 7ab1cde..71b1681 100644 --- a/lib/x11/ApplicationXlib.hpp +++ b/lib/x11/ApplicationXlib.hpp @@ -233,21 +233,19 @@ public: { #if BOO_HAS_VULKAN /* Check for Vulkan presence and preference */ - bool hasVk = loadVk(); - if (hasVk) + bool tryVulkan = true; + for (const std::string& arg : args) { - for (const std::string& arg : args) + if (!arg.compare("--gl")) { - if (!arg.compare("--gl")) - { - dlclose(m_vkHandle); - m_vkHandle = nullptr; - m_getVkProc = 0; - break; - } + tryVulkan = false; + break; } } + if (tryVulkan) + loadVk(); + if (m_getVkProc) Log.report(logvisor::Info, "using Vulkan renderer"); else