diff --git a/CMakeLists.txt b/CMakeLists.txt index bf0903e..aa1237d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -455,6 +455,11 @@ else() if (APPLE) # Apple's binary is universal, so it'll work on both x86_64 and arm64 set (DXC "DYLD_LIBRARY_PATH=${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/dxc/lib/arm64" "${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/dxc/bin/arm64/dxc-macos") + if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64") + set(SPIRVCROSS "DYLD_LIBRARY_PATH=${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/spirv-cross/lib/x64" "${PROJECT_SOURCE_DIR}/lib/rt64//src/contrib/spirv-cross/bin/x64/spirv-cross") + else() + set(SPIRVCROSS "DYLD_LIBRARY_PATH=${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/spirv-cross/lib/arm64" "${PROJECT_SOURCE_DIR}/lib/rt64//src/contrib/spirv-cross/bin/x64/spirv-cross") + endif() else() if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64") set (DXC "LD_LIBRARY_PATH=${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/dxc/lib/x64" "${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/dxc/bin/x64/dxc") diff --git a/lib/N64ModernRuntime b/lib/N64ModernRuntime index 3e39c2e..45d1db0 160000 --- a/lib/N64ModernRuntime +++ b/lib/N64ModernRuntime @@ -1 +1 @@ -Subproject commit 3e39c2ec34340e245a5b7e353560b5a793b9990b +Subproject commit 45d1db07b0a151c89277f5dc89c53c58bfcf74eb diff --git a/lib/rt64 b/lib/rt64 index d4bc18b..0a33064 160000 --- a/lib/rt64 +++ b/lib/rt64 @@ -1 +1 @@ -Subproject commit d4bc18b84855938ed7949cecbda918bca37591c1 +Subproject commit 0a330643bb18e7eddb9c9cf324a668a0d66d7516 diff --git a/src/main/rt64_render_context.cpp b/src/main/rt64_render_context.cpp index 40d331a..1df087a 100644 --- a/src/main/rt64_render_context.cpp +++ b/src/main/rt64_render_context.cpp @@ -207,7 +207,7 @@ zelda64::renderer::RT64Context::RT64Context(uint8_t* rdram, ultramodern::rendere appCore.window.window = window_handle.window; #elif defined(__APPLE__) appCore.window.window = window_handle.window; - appCore.window.layer = window_handle.view; + appCore.window.view = window_handle.view; #endif appCore.checkInterrupts = dummy_check_interrupts; @@ -266,6 +266,9 @@ zelda64::renderer::RT64Context::RT64Context(uint8_t* rdram, ultramodern::rendere case ultramodern::renderer::GraphicsApi::Vulkan: app->userConfig.graphicsAPI = RT64::UserConfiguration::GraphicsAPI::Vulkan; break; + case ultramodern::renderer::GraphicsApi::Metal: + app->userConfig.graphicsAPI = RT64::UserConfiguration::GraphicsAPI::Metal; + break; default: case ultramodern::renderer::GraphicsApi::Auto: // Don't override if auto is selected. diff --git a/src/ui/ui_renderer.cpp b/src/ui/ui_renderer.cpp index a93d7ad..211d033 100644 --- a/src/ui/ui_renderer.cpp +++ b/src/ui/ui_renderer.cpp @@ -35,6 +35,9 @@ #ifdef _WIN32 # include "InterfaceVS.hlsl.dxil.h" # include "InterfacePS.hlsl.dxil.h" +#elif defined(__APPLE__) +# include "InterfaceVS.hlsl.metal.h" +# include "InterfacePS.hlsl.metal.h" #endif #ifdef _WIN32 @@ -44,6 +47,13 @@ # define GET_SHADER_SIZE(name, format) \ ((format) == RT64::RenderShaderFormat::SPIRV ? std::size(name##BlobSPIRV) : \ (format) == RT64::RenderShaderFormat::DXIL ? std::size(name##BlobDXIL) : 0) +#elif defined(__APPLE__) +# define GET_SHADER_BLOB(name, format) \ + ((format) == RT64::RenderShaderFormat::SPIRV ? name##BlobSPIRV : \ + (format) == RT64::RenderShaderFormat::METAL ? name##BlobMSL : nullptr) +# define GET_SHADER_SIZE(name, format) \ + ((format) == RT64::RenderShaderFormat::SPIRV ? std::size(name##BlobSPIRV) : \ + (format) == RT64::RenderShaderFormat::METAL ? std::size(name##BlobMSL) : 0) #else # define GET_SHADER_BLOB(name, format) \ ((format) == RT64::RenderShaderFormat::SPIRV ? name##BlobSPIRV : nullptr)