mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-11 05:26:24 +02:00
Initial support for vulkan on macOS ( MoltenVK )
This commit is contained in:
11 files changed
+76
-17
No files matched your search
@@ -8,6 +8,9 @@
|
||||
|
||||
#include "Core/System.h"
|
||||
#include "SDLVulkanGraphicsContext.h"
|
||||
#if defined(VK_USE_PLATFORM_METAL_EXT)
|
||||
#include "SDLCocoaMetalLayer.h"
|
||||
#endif
|
||||
|
||||
bool SDLVulkanGraphicsContext::Init(SDL_Window *&window, int x, int y, int mode, std::string *error_message) {
|
||||
window = SDL_CreateWindow("Initializing Vulkan...", x, y, pixel_xres, pixel_yres, mode);
|
||||
@@ -50,7 +53,6 @@ bool SDLVulkanGraphicsContext::Init(SDL_Window *&window, int x, int y, int mode,
|
||||
return false;
|
||||
}
|
||||
|
||||
#if !defined(__APPLE__)
|
||||
SDL_SysWMinfo sys_info{};
|
||||
SDL_VERSION(&sys_info.version); //Set SDL version
|
||||
if (!SDL_GetWindowWMInfo(window, &sys_info)) {
|
||||
@@ -71,13 +73,17 @@ bool SDLVulkanGraphicsContext::Init(SDL_Window *&window, int x, int y, int mode,
|
||||
case SDL_SYSWM_WAYLAND:
|
||||
vulkan_->InitSurface(WINDOWSYSTEM_WAYLAND, (void*)sys_info.info.wl.display, (void *)sys_info.info.wl.surface);
|
||||
break;
|
||||
#endif
|
||||
#if defined(VK_USE_PLATFORM_METAL_EXT)
|
||||
case SDL_SYSWM_COCOA:
|
||||
vulkan_->InitSurface(WINDOWSYSTEM_METAL_EXT, makeWindowMetalCompatible(sys_info.info.cocoa.window), nullptr);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
fprintf(stderr, "Vulkan subsystem %d not supported\n", sys_info.subsystem);
|
||||
exit(1);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!vulkan_->InitObjects()) {
|
||||
*error_message = vulkan_->InitError();
|
||||
|
||||
Reference in new issue
Block a user