From d9443d670ef8413971fe7c3f02368b60a7fc5904 Mon Sep 17 00:00:00 2001 From: Simon Kallweit Date: Mon, 27 May 2024 06:03:13 -0700 Subject: [gfx] metal backend skeleton (#4223) * add metal-cpp submodule * add metal-cpp cmake target * gfx metal backend skeleton * add premake support * add foundation framework * add metal-cpp include to premake * update vs project file --------- Co-authored-by: Simon Kallweit Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> --- tools/gfx/render.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tools/gfx/render.cpp') diff --git a/tools/gfx/render.cpp b/tools/gfx/render.cpp index 68f81fba5..f6e32fef8 100644 --- a/tools/gfx/render.cpp +++ b/tools/gfx/render.cpp @@ -13,6 +13,7 @@ using namespace Slang; Result SLANG_MCALL createD3D11Device(const IDevice::Desc* desc, IDevice** outDevice); Result SLANG_MCALL createD3D12Device(const IDevice::Desc* desc, IDevice** outDevice); Result SLANG_MCALL createVKDevice(const IDevice::Desc* desc, IDevice** outDevice); +Result SLANG_MCALL createMetalDevice(const IDevice::Desc* desc, IDevice** outDevice); Result SLANG_MCALL createCUDADevice(const IDevice::Desc* desc, IDevice** outDevice); Result SLANG_MCALL createCPUDevice(const IDevice::Desc* desc, IDevice** outDevice); @@ -328,7 +329,17 @@ extern "C" return SLANG_FAIL; } break; -#elif (SLANG_LINUX_FAMILY || SLANG_APPLE_FAMILY) && !defined(__CYGWIN__) +#elif SLANG_APPLE_FAMILY + case DeviceType::Default: + case DeviceType::Metal: + { + return createMetalDevice(desc, outDevice); + } + case DeviceType::Vulkan: + { + return createVKDevice(desc, outDevice); + } +#elif SLANG_LINUX_FAMILY && !defined(__CYGWIN__) case DeviceType::Default: case DeviceType::Vulkan: { -- cgit v1.2.3