diff --git a/platform/ios/display_server_ios.mm b/platform/ios/display_server_ios.mm index c371f2777cb..2895dffdfae 100644 --- a/platform/ios/display_server_ios.mm +++ b/platform/ios/display_server_ios.mm @@ -80,7 +80,7 @@ DisplayServerIOS::DisplayServerIOS(const String &p_rendering_driver, WindowMode if (!layer) { ERR_FAIL_MSG("Failed to create iOS Vulkan rendering layer."); } - wpd.vulkan.layer_ptr = &layer; + wpd.vulkan.layer_ptr = (CAMetalLayer *const *)&layer; rendering_context = memnew(RenderingContextDriverVulkanIOS); } #endif diff --git a/platform/ios/rendering_context_driver_vulkan_ios.h b/platform/ios/rendering_context_driver_vulkan_ios.h index 0778993a05d..dc85ff738dc 100644 --- a/platform/ios/rendering_context_driver_vulkan_ios.h +++ b/platform/ios/rendering_context_driver_vulkan_ios.h @@ -35,7 +35,7 @@ #include "drivers/vulkan/rendering_context_driver_vulkan.h" -#import +#import class RenderingContextDriverVulkanIOS : public RenderingContextDriverVulkan { private: @@ -46,7 +46,7 @@ protected: public: struct WindowPlatformData { - CALayer *const *layer_ptr; + CAMetalLayer *const *layer_ptr; }; RenderingContextDriverVulkanIOS(); diff --git a/platform/ios/rendering_context_driver_vulkan_ios.mm b/platform/ios/rendering_context_driver_vulkan_ios.mm index 7e9c3e0e441..6a6af1bc419 100644 --- a/platform/ios/rendering_context_driver_vulkan_ios.mm +++ b/platform/ios/rendering_context_driver_vulkan_ios.mm @@ -35,22 +35,22 @@ #ifdef USE_VOLK #include #else -#include +#include #endif const char *RenderingContextDriverVulkanIOS::_get_platform_surface_extension() const { - return VK_MVK_IOS_SURFACE_EXTENSION_NAME; + return VK_EXT_METAL_SURFACE_EXTENSION_NAME; } RenderingContextDriver::SurfaceID RenderingContextDriverVulkanIOS::surface_create(const void *p_platform_data) { const WindowPlatformData *wpd = (const WindowPlatformData *)(p_platform_data); - VkIOSSurfaceCreateInfoMVK create_info = {}; - create_info.sType = VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK; - create_info.pView = (__bridge const void *)(*wpd->layer_ptr); + VkMetalSurfaceCreateInfoEXT create_info = {}; + create_info.sType = VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT; + create_info.pLayer = *wpd->layer_ptr; VkSurfaceKHR vk_surface = VK_NULL_HANDLE; - VkResult err = vkCreateIOSSurfaceMVK(instance_get(), &create_info, nullptr, &vk_surface); + VkResult err = vkCreateMetalSurfaceEXT(instance_get(), &create_info, nullptr, &vk_surface); ERR_FAIL_COND_V(err != VK_SUCCESS, SurfaceID()); Surface *surface = memnew(Surface); diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm index ad8afaf46b2..114b371580b 100644 --- a/platform/macos/display_server_macos.mm +++ b/platform/macos/display_server_macos.mm @@ -203,7 +203,7 @@ DisplayServerMacOS::WindowID DisplayServerMacOS::_create_window(WindowMode p_mod } wpd; #ifdef VULKAN_ENABLED if (rendering_driver == "vulkan") { - wpd.vulkan.view_ptr = &wd.window_view; + wpd.vulkan.layer_ptr = (CAMetalLayer *const *)&layer; } #endif Error err = rendering_context->window_create(window_id_counter, &wpd); diff --git a/platform/macos/rendering_context_driver_vulkan_macos.h b/platform/macos/rendering_context_driver_vulkan_macos.h index bbc67581dbd..32f8891a2ea 100644 --- a/platform/macos/rendering_context_driver_vulkan_macos.h +++ b/platform/macos/rendering_context_driver_vulkan_macos.h @@ -35,7 +35,7 @@ #include "drivers/vulkan/rendering_context_driver_vulkan.h" -#import +#import class RenderingContextDriverVulkanMacOS : public RenderingContextDriverVulkan { private: @@ -46,7 +46,7 @@ protected: public: struct WindowPlatformData { - const id *view_ptr; + CAMetalLayer *const *layer_ptr; }; RenderingContextDriverVulkanMacOS(); diff --git a/platform/macos/rendering_context_driver_vulkan_macos.mm b/platform/macos/rendering_context_driver_vulkan_macos.mm index e0f8bf9e672..afefe5a6f7d 100644 --- a/platform/macos/rendering_context_driver_vulkan_macos.mm +++ b/platform/macos/rendering_context_driver_vulkan_macos.mm @@ -35,22 +35,22 @@ #ifdef USE_VOLK #include #else -#include +#include #endif const char *RenderingContextDriverVulkanMacOS::_get_platform_surface_extension() const { - return VK_MVK_MACOS_SURFACE_EXTENSION_NAME; + return VK_EXT_METAL_SURFACE_EXTENSION_NAME; } RenderingContextDriver::SurfaceID RenderingContextDriverVulkanMacOS::surface_create(const void *p_platform_data) { const WindowPlatformData *wpd = (const WindowPlatformData *)(p_platform_data); - VkMacOSSurfaceCreateInfoMVK create_info = {}; - create_info.sType = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK; - create_info.pView = (__bridge const void *)(*wpd->view_ptr); + VkMetalSurfaceCreateInfoEXT create_info = {}; + create_info.sType = VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT; + create_info.pLayer = *wpd->layer_ptr; VkSurfaceKHR vk_surface = VK_NULL_HANDLE; - VkResult err = vkCreateMacOSSurfaceMVK(instance_get(), &create_info, nullptr, &vk_surface); + VkResult err = vkCreateMetalSurfaceEXT(instance_get(), &create_info, nullptr, &vk_surface); ERR_FAIL_COND_V(err != VK_SUCCESS, SurfaceID()); Surface *surface = memnew(Surface);