mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-28 06:17:07 +02:00
try both legacy and metal surfaces
This commit is contained in:
parent
c1fc6dcfe0
commit
58052aef42
2 changed files with 3 additions and 6 deletions
|
|
@ -11,7 +11,7 @@
|
||||||
#define VK_USE_PLATFORM_WIN32_KHR
|
#define VK_USE_PLATFORM_WIN32_KHR
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
#define VK_USE_PLATFORM_METAL_EXT
|
#define VK_USE_PLATFORM_METAL_EXT
|
||||||
//#define VK_USE_PLATFORM_MACOS_MVK
|
#define VK_USE_PLATFORM_MACOS_MVK
|
||||||
#elif defined(__ANDROID__)
|
#elif defined(__ANDROID__)
|
||||||
#define VK_USE_PLATFORM_ANDROID_KHR
|
#define VK_USE_PLATFORM_ANDROID_KHR
|
||||||
#elif defined(__HAIKU__)
|
#elif defined(__HAIKU__)
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,8 @@ vk::SurfaceKHR CreateSurface(
|
||||||
.flags = 0,
|
.flags = 0,
|
||||||
.pLayer = static_cast<const CAMetalLayer*>(window_info.render_surface),
|
.pLayer = static_cast<const CAMetalLayer*>(window_info.render_surface),
|
||||||
};
|
};
|
||||||
const auto vkCreateMetalSurfaceEXT = reinterpret_cast<PFN_vkCreateMetalSurfaceEXT>(dld.vkGetInstanceProcAddr(*instance, "vkCreateMetalSurfaceEXT"));
|
const auto vkCreateMetalSurfaceEXT = PFN_vkCreateMetalSurfaceEXT(dld.vkGetInstanceProcAddr(*instance, "vkCreateMetalSurfaceEXT"));
|
||||||
if (!vkCreateMetalSurfaceEXT || vkCreateMetalSurfaceEXT(*instance, &metal_ci, nullptr, &unsafe_surface) != VK_SUCCESS) {
|
if (!vkCreateMetalSurfaceEXT || vkCreateMetalSurfaceEXT(*instance, &metal_ci, nullptr, &unsafe_surface) != VK_SUCCESS) {
|
||||||
#if 0
|
|
||||||
// TODO: Way to fallback? - where's my vulkan headers
|
// TODO: Way to fallback? - where's my vulkan headers
|
||||||
// Attempt to make a macOS surface instead then...
|
// Attempt to make a macOS surface instead then...
|
||||||
// This is the deprecated VkMacOSSurfaceCreateInfoMVK(3) version; but should work if the above failed
|
// This is the deprecated VkMacOSSurfaceCreateInfoMVK(3) version; but should work if the above failed
|
||||||
|
|
@ -51,14 +50,12 @@ vk::SurfaceKHR CreateSurface(
|
||||||
.flags = 0,
|
.flags = 0,
|
||||||
.pView = static_cast<const void*>(window_info.render_surface),
|
.pView = static_cast<const void*>(window_info.render_surface),
|
||||||
};
|
};
|
||||||
const auto vkCreateMacOSSurfaceMVK = reinterpret_cast<PFN_vkCreateMacOSSurfaceMVK>(dld.vkGetInstanceProcAddr(*instance, "vkCreateMacOSSurfaceMVK"));
|
const auto vkCreateMacOSSurfaceMVK = PFN_vkCreateMacOSSurfaceMVK(dld.vkGetInstanceProcAddr(*instance, "vkCreateMacOSSurfaceMVK"));
|
||||||
if (!vkCreateMacOSSurfaceMVK || vkCreateMacOSSurfaceMVK(*instance, &macos_legacy_ci, nullptr, &unsafe_surface) != VK_SUCCESS) {
|
if (!vkCreateMacOSSurfaceMVK || vkCreateMacOSSurfaceMVK(*instance, &macos_legacy_ci, nullptr, &unsafe_surface) != VK_SUCCESS) {
|
||||||
LOG_ERROR(Render_Vulkan, "Failed to initialize Metal/macOS surface");
|
LOG_ERROR(Render_Vulkan, "Failed to initialize Metal/macOS surface");
|
||||||
throw vk::Exception(VK_ERROR_INITIALIZATION_FAILED);
|
throw vk::Exception(VK_ERROR_INITIALIZATION_FAILED);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
LOG_ERROR(Render_Vulkan, "Failed to initialize Metal/macOS surface");
|
LOG_ERROR(Render_Vulkan, "Failed to initialize Metal/macOS surface");
|
||||||
throw vk::Exception(VK_ERROR_INITIALIZATION_FAILED);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#elif defined(__ANDROID__)
|
#elif defined(__ANDROID__)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue