summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/core/slang-render-api-util.cpp4
-rw-r--r--source/core/slang-render-api-util.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/source/core/slang-render-api-util.cpp b/source/core/slang-render-api-util.cpp
index 334e9a9d1..fce66be90 100644
--- a/source/core/slang-render-api-util.cpp
+++ b/source/core/slang-render-api-util.cpp
@@ -17,6 +17,7 @@ namespace Slang {
{ RenderApiType::Vulkan, "vk,vulkan", ""},
{ RenderApiType::D3D12, "dx12,d3d12", ""},
{ RenderApiType::D3D11, "dx11,d3d11", "hlsl,hlsl-rewrite,slang"},
+ { RenderApiType::Metal, "mtl,metal", ""},
{ RenderApiType::CPU, "cpu", ""},
{ RenderApiType::CUDA, "cuda", "cuda,ptx"},
};
@@ -266,6 +267,9 @@ static bool _canLoadSharedLibrary(const char* libName)
#if SLANG_WINDOWS_FAMILY
case RenderApiType::OpenGl: return _canLoadSharedLibrary("opengl32");
case RenderApiType::Vulkan: return _canLoadSharedLibrary("vulkan-1") || _canLoadSharedLibrary("vk_swiftshader");
+#elif SLANG_APPLE_FAMILY
+ case RenderApiType::Vulkan: return true;
+ case RenderApiType::Metal: return true;
#elif SLANG_UNIX_FAMILY
case RenderApiType::OpenGl: return true;
case RenderApiType::Vulkan: return true;
diff --git a/source/core/slang-render-api-util.h b/source/core/slang-render-api-util.h
index b028d3996..7a2848038 100644
--- a/source/core/slang-render-api-util.h
+++ b/source/core/slang-render-api-util.h
@@ -15,6 +15,7 @@ enum class RenderApiType
Vulkan,
D3D12,
D3D11,
+ Metal,
CPU,
CUDA,
CountOf,
@@ -29,6 +30,7 @@ struct RenderApiFlag
Vulkan = 1 << int(RenderApiType::Vulkan),
D3D12 = 1 << int(RenderApiType::D3D12),
D3D11 = 1 << int(RenderApiType::D3D11),
+ Metal = 1 << int(RenderApiType::Metal),
CPU = 1 << int(RenderApiType::CPU),
CUDA = 1 << int(RenderApiType::CUDA),
AllOf = (1 << int(RenderApiType::CountOf)) - 1 ///< All bits set