Add Metal CMake option

Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>
This commit is contained in:
Isaac Marovitz 2025-03-26 09:07:12 -04:00
parent 018f7ee0b4
commit cf89e03486
No known key found for this signature in database
GPG key ID: 97250B2B09A132E1
2 changed files with 11 additions and 0 deletions

View file

@ -4,6 +4,10 @@ if (WIN32)
option(UNLEASHED_RECOMP_D3D12 "Add D3D12 support for rendering" ON)
endif()
if (APPLE)
option(UNLEASHED_RECOMP_METAL "Add Metal support for rendering" ON)
endif()
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
option(UNLEASHED_RECOMP_FLATPAK "Configure the build for Flatpak compatibility." OFF)
endif()

View file

@ -785,6 +785,13 @@ static void LoadEmbeddedResources()
g_shaderCache = std::make_unique<uint8_t[]>(g_spirvCacheDecompressedSize);
ZSTD_decompress(g_shaderCache.get(), g_spirvCacheDecompressedSize, g_compressedSpirvCache, g_spirvCacheCompressedSize);
}
#ifdef UNLEASHED_RECOMP_METAL
else
{
g_shaderCache = std::make_unique<uint8_t[]>(g_airCacheDecompressedSize);
ZSTD_decompress(g_shaderCache.get(), g_airCacheDecompressedSize, g_compressedAirCache, g_airCacheCompressedSize);
}
#endif
#ifdef UNLEASHED_RECOMP_D3D12
else
{