From a7a554479fb340c733a70f09e510cb3de57e1ef7 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Thu, 20 Jun 2024 19:21:47 +0200 Subject: [PATCH] Vulkan: Fix compilation issue macOs due to renamed variable Pull Request: https://projects.blender.org/blender/blender/pulls/123503 --- intern/ghost/CMakeLists.txt | 4 ++-- intern/ghost/intern/GHOST_ContextVK.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt index 92e7cbf1617..745e221f19f 100644 --- a/intern/ghost/CMakeLists.txt +++ b/intern/ghost/CMakeLists.txt @@ -90,8 +90,7 @@ if(WITH_OPENGL_BACKEND) endif() if(WITH_VULKAN_BACKEND) - - if(APPLE) + if (WITH_VULKAN_MOLTENVK) list(APPEND INC_SYS PUBLIC ${MOLTENVK_INCLUDE_DIRS} ) @@ -99,6 +98,7 @@ if(WITH_VULKAN_BACKEND) list(APPEND LIB ${MOLTENVK_LIBRARIES} ) + add_definitions(-DWITH_VULKAN_MOLTENVK) endif() list(APPEND SRC diff --git a/intern/ghost/intern/GHOST_ContextVK.cc b/intern/ghost/intern/GHOST_ContextVK.cc index 5ef305a5765..b32ccc301b6 100644 --- a/intern/ghost/intern/GHOST_ContextVK.cc +++ b/intern/ghost/intern/GHOST_ContextVK.cc @@ -1054,12 +1054,12 @@ GHOST_TSuccess GHOST_ContextVK::initializeDrawingContext() if (vulkan_device->has_extensions({VK_KHR_MAINTENANCE_4_EXTENSION_NAME})) { required_device_extensions.push_back(VK_KHR_MAINTENANCE_4_EXTENSION_NAME); } -#ifdef VK_MVK_MOLTENVK_EXTENSION_NAME +#ifdef WITH_VULKAN_MOLTENVK /* According to the Vulkan specs, when `VK_KHR_portability_subset` is available it should be * enabled. See * https://vulkan.lunarg.com/doc/view/1.2.198.1/mac/1.2-extensions/vkspec.html#VUID-VkDeviceCreateInfo-pProperties-04451*/ if (vulkan_device->has_extensions({VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME})) { - extensions_device.push_back(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME); + required_device_extensions.push_back(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME); } #endif vulkan_device->ensure_device(required_device_extensions, optional_device_extensions);