From 97fc3aa9a65bdcc365d150de35590238905e67f8 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 17 Mar 2019 14:45:19 +0200 Subject: [PATCH] - avoid Vulkan initialization when it's disabled in Cocoa backend --- src/posix/cocoa/i_video.mm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index 2d0bb11135..f89331edea 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -364,24 +364,24 @@ public: vulkanView.layer.backgroundColor = NSColor.blackColor.CGColor; [ms_window setContentView:vulkanView]; + + try + { + m_vulkanDevice = new VulkanDevice(); + fb = new VulkanFrameBuffer(nullptr, fullscreen, m_vulkanDevice); + } + catch (std::exception const&) + { + ms_isVulkanEnabled = false; + + SetupOpenGLView(ms_window); + } } else { SetupOpenGLView(ms_window); } - try - { - m_vulkanDevice = new VulkanDevice(); - fb = new VulkanFrameBuffer(nullptr, fullscreen, m_vulkanDevice); - } - catch (std::exception const&) - { - ms_isVulkanEnabled = false; - - SetupOpenGLView(ms_window); - } - if (fb == nullptr) { fb = new OpenGLRenderer::OpenGLFrameBuffer(0, fullscreen);