mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-20 17:59:08 +02:00
Metal: Leave the backend out of the libretro cores
They get their graphics context from the frontend, so they compiled and linked the Metal backend without being able to use it. Adds PPSSPP_API_METAL, like PPSSPP_API_D3D11, for the code that only exists with it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
987a904cff
commit
b2fc4a80fe
7 files changed
+15
-9
No files matched your search
+2
-1
@@ -1135,7 +1135,8 @@ if(WIN32)
|
||||
list(APPEND GlslangLibs spirv-cross-hlsl)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
# The Metal backend. Not in the libretro cores, which get their graphics context from the frontend.
|
||||
if(APPLE AND NOT LIBRETRO)
|
||||
list(APPEND GlslangLibs spirv-cross-msl)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ if(NOT NO_OPENGL)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
if(APPLE AND NOT LIBRETRO)
|
||||
set(CommonMetal
|
||||
GPU/Metal/MetalGraphicsContext.h
|
||||
GPU/Metal/MetalGraphicsContext.mm
|
||||
@@ -420,7 +420,7 @@ if(TARGET Ext::GLEW)
|
||||
target_link_libraries(Common Ext::GLEW)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
if(APPLE AND NOT LIBRETRO)
|
||||
target_link_libraries(Common "-framework Metal" "-framework QuartzCore")
|
||||
endif()
|
||||
|
||||
|
||||
+1
-1
@@ -609,7 +609,7 @@ bool Config::IsBackendEnabled(GPUBackend backend) {
|
||||
return false;
|
||||
#endif
|
||||
|
||||
#if !PPSSPP_PLATFORM(MAC) && !PPSSPP_PLATFORM(IOS)
|
||||
#if !PPSSPP_API(METAL)
|
||||
if (backend == GPUBackend::METAL)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ endif()
|
||||
if(WIN32)
|
||||
list(APPEND GPU_IMPLS ${GPU_D3D11})
|
||||
endif()
|
||||
if(APPLE)
|
||||
if(APPLE AND NOT LIBRETRO)
|
||||
set(GPU_METAL
|
||||
Metal/DrawEngineMetal.h
|
||||
Metal/DrawEngineMetal.mm
|
||||
|
||||
+2
-2
@@ -37,7 +37,7 @@
|
||||
#include "GPU/D3D11/GPU_D3D11.h"
|
||||
#endif
|
||||
|
||||
#if PPSSPP_PLATFORM(MAC) || PPSSPP_PLATFORM(IOS)
|
||||
#if PPSSPP_API(METAL)
|
||||
#include "GPU/Metal/GPU_Metal.h"
|
||||
#endif
|
||||
|
||||
@@ -75,7 +75,7 @@ static GPUCommon *CreateGPUCore(GPUCore gpuCore, GraphicsContext *ctx, Draw::Dra
|
||||
return new GPU_Vulkan(ctx, draw);
|
||||
#endif
|
||||
case GPUCORE_METAL:
|
||||
#if PPSSPP_PLATFORM(MAC) || PPSSPP_PLATFORM(IOS)
|
||||
#if PPSSPP_API(METAL)
|
||||
return new GPU_Metal(ctx, draw);
|
||||
#else
|
||||
return nullptr;
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include "Common/StringUtils.h"
|
||||
#include "Common/Thread/ThreadManager.h"
|
||||
#include "Common/GPU/Vulkan/VulkanGraphicsContext.h"
|
||||
#if PPSSPP_PLATFORM(MAC) || PPSSPP_PLATFORM(IOS)
|
||||
#if PPSSPP_API(METAL)
|
||||
#include "Common/GPU/Metal/MetalGraphicsContext.h"
|
||||
#endif
|
||||
#include "Core/CmdLine.h"
|
||||
@@ -1112,7 +1112,7 @@ int main(int argc, const char* argv[]) {
|
||||
vulkanContext->SetOffscreen(480, 272);
|
||||
graphicsContext = vulkanContext;
|
||||
deviceSetting = &g_Config.sVulkanDevice;
|
||||
#if PPSSPP_PLATFORM(MAC) || PPSSPP_PLATFORM(IOS)
|
||||
#if PPSSPP_API(METAL)
|
||||
} else if (gpuCore == GPUCORE_METAL) {
|
||||
MetalGraphicsContext *metalContext = new MetalGraphicsContext();
|
||||
metalContext->SetOffscreen(480, 272);
|
||||
|
||||
@@ -143,3 +143,8 @@
|
||||
#if PPSSPP_PLATFORM(WINDOWS)
|
||||
#define PPSSPP_API_D3D11 1
|
||||
#endif
|
||||
|
||||
// Not in the libretro cores, which get their graphics context from the frontend.
|
||||
#if (PPSSPP_PLATFORM(MAC) || PPSSPP_PLATFORM(IOS)) && !defined(__LIBRETRO__)
|
||||
#define PPSSPP_API_METAL 1
|
||||
#endif
|
||||
Reference in new issue
Block a user