mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 07:21:14 +01:00
Merge pull request #8728 from stenzek/update-mvk
Vulkan: Switch from vkCreateMacOSSurfaceMVK() to vkCreateMetalSurfaceEXT() and Update MoltenVK
This commit is contained in:
commit
960ba4fe5e
BIN
Externals/MoltenVK/libvulkan.dylib
vendored
BIN
Externals/MoltenVK/libvulkan.dylib
vendored
Binary file not shown.
4
Externals/MoltenVK/version.txt
vendored
4
Externals/MoltenVK/version.txt
vendored
@ -1,3 +1,3 @@
|
||||
libMoltenVK.dylib from vulkansdk-macos-1.1.108.0, renamed to libvulkan.dylib
|
||||
MoltenVK/macOS/dynamic/libMoltenVK.dylib from vulkansdk-macos-1.2.131.2, renamed to libvulkan.dylib
|
||||
|
||||
Downloaded from: https://sdk.lunarg.com/sdk/download/1.1.108.0/mac/vulkansdk-macos-1.1.108.0.tar.gz
|
||||
Downloaded from: https://sdk.lunarg.com/sdk/download/1.2.131.2/mac/vulkansdk-macos-1.2.131.2.tar.gz
|
||||
|
@ -107,17 +107,18 @@ VkSurfaceKHR SwapChain::CreateVulkanSurface(VkInstance instance, const WindowSys
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(VK_USE_PLATFORM_MACOS_MVK)
|
||||
#if defined(VK_USE_PLATFORM_METAL_EXT)
|
||||
if (wsi.type == WindowSystemType::MacOS)
|
||||
{
|
||||
VkMacOSSurfaceCreateInfoMVK surface_create_info = {
|
||||
VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK, nullptr, 0, wsi.render_surface};
|
||||
VkMetalSurfaceCreateInfoEXT surface_create_info = {
|
||||
VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT, nullptr, 0,
|
||||
static_cast<const CAMetalLayer*>(wsi.render_surface)};
|
||||
|
||||
VkSurfaceKHR surface;
|
||||
VkResult res = vkCreateMacOSSurfaceMVK(instance, &surface_create_info, nullptr, &surface);
|
||||
VkResult res = vkCreateMetalSurfaceEXT(instance, &surface_create_info, nullptr, &surface);
|
||||
if (res != VK_SUCCESS)
|
||||
{
|
||||
LOG_VULKAN_ERROR(res, "vkCreateMacOSSurfaceMVK failed: ");
|
||||
LOG_VULKAN_ERROR(res, "vkCreateMetalSurfaceEXT failed: ");
|
||||
return VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
|
@ -211,8 +211,8 @@ bool VulkanContext::SelectInstanceExtensions(std::vector<const char*>* extension
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
#if defined(VK_USE_PLATFORM_MACOS_MVK)
|
||||
if (wstype == WindowSystemType::MacOS && !AddExtension(VK_MVK_MACOS_SURFACE_EXTENSION_NAME, true))
|
||||
#if defined(VK_USE_PLATFORM_METAL_EXT)
|
||||
if (wstype == WindowSystemType::MacOS && !AddExtension(VK_EXT_METAL_SURFACE_EXTENSION_NAME, true))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -53,8 +53,8 @@ VULKAN_INSTANCE_ENTRY_POINT(vkGetPhysicalDeviceXlibPresentationSupportKHR, false
|
||||
VULKAN_INSTANCE_ENTRY_POINT(vkCreateAndroidSurfaceKHR, false)
|
||||
#endif
|
||||
|
||||
#if defined(VK_USE_PLATFORM_MACOS_MVK)
|
||||
VULKAN_INSTANCE_ENTRY_POINT(vkCreateMacOSSurfaceMVK, false)
|
||||
#if defined(VK_USE_PLATFORM_METAL_EXT)
|
||||
VULKAN_INSTANCE_ENTRY_POINT(vkCreateMetalSurfaceEXT, false)
|
||||
#endif
|
||||
|
||||
VULKAN_INSTANCE_ENTRY_POINT(vkCreateDebugReportCallbackEXT, false)
|
||||
|
@ -19,7 +19,7 @@
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#define VK_USE_PLATFORM_MACOS_MVK
|
||||
#define VK_USE_PLATFORM_METAL_EXT
|
||||
#endif
|
||||
|
||||
#include "vulkan/vulkan.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "VideoCommon/VideoBackendBase.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
|
||||
#if defined(VK_USE_PLATFORM_MACOS_MVK)
|
||||
#if defined(VK_USE_PLATFORM_METAL_EXT)
|
||||
#include <objc/message.h>
|
||||
#endif
|
||||
|
||||
@ -280,7 +280,7 @@ void VideoBackend::Shutdown()
|
||||
UnloadVulkanLibrary();
|
||||
}
|
||||
|
||||
#if defined(VK_USE_PLATFORM_MACOS_MVK)
|
||||
#if defined(VK_USE_PLATFORM_METAL_EXT)
|
||||
static bool IsRunningOnMojaveOrHigher()
|
||||
{
|
||||
// id processInfo = [NSProcessInfo processInfo]
|
||||
@ -306,7 +306,7 @@ static bool IsRunningOnMojaveOrHigher()
|
||||
|
||||
void VideoBackend::PrepareWindow(WindowSystemInfo& wsi)
|
||||
{
|
||||
#if defined(VK_USE_PLATFORM_MACOS_MVK)
|
||||
#if defined(VK_USE_PLATFORM_METAL_EXT)
|
||||
// This is kinda messy, but it avoids having to write Objective C++ just to create a metal layer.
|
||||
id view = reinterpret_cast<id>(wsi.render_surface);
|
||||
Class clsCAMetalLayer = objc_getClass("CAMetalLayer");
|
||||
|
Loading…
x
Reference in New Issue
Block a user