From 3810d9beb363b1f5de46d7dec0ee67a622f969c4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 27 Jun 2019 09:10:20 +0200 Subject: [PATCH] - Make HAVE_VULKAN an option so that it can be disabled Had to compile on a Mac with no MoltenVK and no Vulkan SDK. --- CMakeLists.txt | 2 +- src/posix/cocoa/i_video.mm | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e04684de..47dca83d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,7 +155,7 @@ target_architecture(ZDOOM_TARGET_ARCH) if( ${ZDOOM_TARGET_ARCH} MATCHES "x86_64" ) set( HAVE_VM_JIT ON ) - set( HAVE_VULKAN ON ) + option (HAVE_VULKAN "Enable Vulkan support" ON) endif() # no, we're not using external asmjit for now, we made too many modifications to our's. diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index 8d6b203f2..50529e6ca 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -355,8 +355,9 @@ public: ~CocoaVideo() { +#ifdef HAVE_VULKAN delete m_vulkanDevice; - +#endif ms_window = nil; } @@ -367,6 +368,7 @@ public: SystemBaseFrameBuffer *fb = nullptr; +#ifdef HAVE_VULKAN if (ms_isVulkanEnabled) { const NSRect contentRect = [ms_window contentRectForFrameRect:[ms_window frame]]; @@ -421,6 +423,7 @@ public: } } else +#endif { SetupOpenGLView(ms_window); }