summaryrefslogtreecommitdiff
path: root/tools/gfx/metal
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-11-06 01:47:26 +0800
committerGitHub <noreply@github.com>2024-11-05 09:47:26 -0800
commitb118451e301d734e3e783b3acdf871f3f6ea851c (patch)
tree277f160d31e2c442f724bc6a2d3c09fabff403ca /tools/gfx/metal
parent53dd5928c35d5a5cb1f7d2a563348fd1fa87d672 (diff)
Move switch statement bodies to their own lines (#5493)
* Move switch statement bodies to their own lines * format --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tools/gfx/metal')
-rw-r--r--tools/gfx/metal/metal-command-encoder.cpp11
-rw-r--r--tools/gfx/metal/metal-device.cpp24
-rw-r--r--tools/gfx/metal/metal-pipeline-state.cpp15
-rw-r--r--tools/gfx/metal/metal-render-pass.cpp21
-rw-r--r--tools/gfx/metal/metal-shader-object-layout.cpp3
-rw-r--r--tools/gfx/metal/metal-shader-object.cpp3
-rw-r--r--tools/gfx/metal/metal-util.cpp659
7 files changed, 488 insertions, 248 deletions
diff --git a/tools/gfx/metal/metal-command-encoder.cpp b/tools/gfx/metal/metal-command-encoder.cpp
index f4c393193..cd6682172 100644
--- a/tools/gfx/metal/metal-command-encoder.cpp
+++ b/tools/gfx/metal/metal-command-encoder.cpp
@@ -363,9 +363,14 @@ void RenderCommandEncoder::setIndexBuffer(
switch (indexFormat)
{
- case Format::R16_UINT: m_indexBufferType = MTL::IndexTypeUInt16; break;
- case Format::R32_UINT: m_indexBufferType = MTL::IndexTypeUInt32; break;
- default: assert(!"unsupported index format");
+ case Format::R16_UINT:
+ m_indexBufferType = MTL::IndexTypeUInt16;
+ break;
+ case Format::R32_UINT:
+ m_indexBufferType = MTL::IndexTypeUInt32;
+ break;
+ default:
+ assert(!"unsupported index format");
}
}
diff --git a/tools/gfx/metal/metal-device.cpp b/tools/gfx/metal/metal-device.cpp
index ff534a78c..a536f64ff 100644
--- a/tools/gfx/metal/metal-device.cpp
+++ b/tools/gfx/metal/metal-device.cpp
@@ -392,12 +392,16 @@ Result DeviceImpl::createTextureResource(
NS::TransferPtr(MTL::TextureDescriptor::alloc()->init());
switch (desc.memoryType)
{
- case MemoryType::DeviceLocal: textureDesc->setStorageMode(MTL::StorageModePrivate); break;
+ case MemoryType::DeviceLocal:
+ textureDesc->setStorageMode(MTL::StorageModePrivate);
+ break;
case MemoryType::Upload:
textureDesc->setStorageMode(MTL::StorageModeShared);
textureDesc->setCpuCacheMode(MTL::CPUCacheModeWriteCombined);
break;
- case MemoryType::ReadBack: textureDesc->setStorageMode(MTL::StorageModeShared); break;
+ case MemoryType::ReadBack:
+ textureDesc->setStorageMode(MTL::StorageModeShared);
+ break;
}
bool isArray = desc.arraySize > 0;
@@ -433,7 +437,9 @@ Result DeviceImpl::createTextureResource(
textureDesc->setHeight(descIn.size.height);
textureDesc->setDepth(descIn.size.depth);
break;
- default: assert("!Unsupported texture type"); return SLANG_FAIL;
+ default:
+ assert("!Unsupported texture type");
+ return SLANG_FAIL;
}
MTL::TextureUsage textureUsage = MTL::TextureUsageUnknown;
@@ -456,7 +462,9 @@ Result DeviceImpl::createTextureResource(
case Format::R32_UINT:
case Format::R32_SINT:
case Format::R32G32_UINT:
- case Format::R32G32_SINT: textureUsage |= MTL::TextureUsageShaderAtomic; break;
+ case Format::R32G32_SINT:
+ textureUsage |= MTL::TextureUsageShaderAtomic;
+ break;
}
}
@@ -548,11 +556,15 @@ Result DeviceImpl::createBufferResource(
MTL::ResourceOptions resourceOptions = MTL::ResourceOptions(0);
switch (desc.memoryType)
{
- case MemoryType::DeviceLocal: resourceOptions = MTL::ResourceStorageModePrivate; break;
+ case MemoryType::DeviceLocal:
+ resourceOptions = MTL::ResourceStorageModePrivate;
+ break;
case MemoryType::Upload:
resourceOptions = MTL::ResourceStorageModeShared | MTL::CPUCacheModeWriteCombined;
break;
- case MemoryType::ReadBack: resourceOptions = MTL::ResourceStorageModeShared; break;
+ case MemoryType::ReadBack:
+ resourceOptions = MTL::ResourceStorageModeShared;
+ break;
}
resourceOptions |= (desc.memoryType == MemoryType::DeviceLocal)
? MTL::ResourceStorageModePrivate
diff --git a/tools/gfx/metal/metal-pipeline-state.cpp b/tools/gfx/metal/metal-pipeline-state.cpp
index c2a9afaac..cda38b611 100644
--- a/tools/gfx/metal/metal-pipeline-state.cpp
+++ b/tools/gfx/metal/metal-pipeline-state.cpp
@@ -65,9 +65,14 @@ Result PipelineStateImpl::createMetalRenderPipelineState()
switch (module.stage)
{
- case SLANG_STAGE_VERTEX: pd->setVertexFunction(function.get()); break;
- case SLANG_STAGE_FRAGMENT: pd->setFragmentFunction(function.get()); break;
- default: return SLANG_FAIL;
+ case SLANG_STAGE_VERTEX:
+ pd->setVertexFunction(function.get());
+ break;
+ case SLANG_STAGE_FRAGMENT:
+ pd->setFragmentFunction(function.get());
+ break;
+ default:
+ return SLANG_FAIL;
}
}
@@ -236,7 +241,9 @@ Result PipelineStateImpl::ensureAPIPipelineStateCreated()
return m_computePipelineState ? SLANG_OK : createMetalComputePipelineState();
case PipelineType::Graphics:
return m_renderPipelineState ? SLANG_OK : createMetalRenderPipelineState();
- default: SLANG_UNREACHABLE("Unknown pipeline type."); return SLANG_FAIL;
+ default:
+ SLANG_UNREACHABLE("Unknown pipeline type.");
+ return SLANG_FAIL;
}
return SLANG_OK;
}
diff --git a/tools/gfx/metal/metal-render-pass.cpp b/tools/gfx/metal/metal-render-pass.cpp
index 49e470028..2b8cf61d2 100644
--- a/tools/gfx/metal/metal-render-pass.cpp
+++ b/tools/gfx/metal/metal-render-pass.cpp
@@ -22,10 +22,14 @@ static inline MTL::LoadAction translateLoadOp(IRenderPassLayout::TargetLoadOp lo
{
switch (loadOp)
{
- case IRenderPassLayout::TargetLoadOp::Load: return MTL::LoadActionLoad;
- case IRenderPassLayout::TargetLoadOp::Clear: return MTL::LoadActionClear;
- case IRenderPassLayout::TargetLoadOp::DontCare: return MTL::LoadActionDontCare;
- default: return MTL::LoadAction(0);
+ case IRenderPassLayout::TargetLoadOp::Load:
+ return MTL::LoadActionLoad;
+ case IRenderPassLayout::TargetLoadOp::Clear:
+ return MTL::LoadActionClear;
+ case IRenderPassLayout::TargetLoadOp::DontCare:
+ return MTL::LoadActionDontCare;
+ default:
+ return MTL::LoadAction(0);
}
}
@@ -33,9 +37,12 @@ static inline MTL::StoreAction translateStoreOp(IRenderPassLayout::TargetStoreOp
{
switch (storeOp)
{
- case IRenderPassLayout::TargetStoreOp::Store: return MTL::StoreActionStore;
- case IRenderPassLayout::TargetStoreOp::DontCare: return MTL::StoreActionDontCare;
- default: return MTL::StoreAction(0);
+ case IRenderPassLayout::TargetStoreOp::Store:
+ return MTL::StoreActionStore;
+ case IRenderPassLayout::TargetStoreOp::DontCare:
+ return MTL::StoreActionDontCare;
+ default:
+ return MTL::StoreAction(0);
}
}
diff --git a/tools/gfx/metal/metal-shader-object-layout.cpp b/tools/gfx/metal/metal-shader-object-layout.cpp
index e674b830a..c233d706c 100644
--- a/tools/gfx/metal/metal-shader-object-layout.cpp
+++ b/tools/gfx/metal/metal-shader-object-layout.cpp
@@ -95,7 +95,8 @@ Result ShaderObjectLayoutImpl::Builder::setElementTypeLayout(
m_textureCount += count;
m_textureRanges.add(r);
break;
- default: break;
+ default:
+ break;
}
// We'd like to extract the information on the Metal resource
diff --git a/tools/gfx/metal/metal-shader-object.cpp b/tools/gfx/metal/metal-shader-object.cpp
index 7ee7e8023..adbecdfe1 100644
--- a/tools/gfx/metal/metal-shader-object.cpp
+++ b/tools/gfx/metal/metal-shader-object.cpp
@@ -674,7 +674,8 @@ Result ShaderObjectImpl::bindAsValue(
break;
#endif
- default: break;
+ default:
+ break;
}
}
diff --git a/tools/gfx/metal/metal-util.cpp b/tools/gfx/metal/metal-util.cpp
index fd2e9e009..60d1c7465 100644
--- a/tools/gfx/metal/metal-util.cpp
+++ b/tools/gfx/metal/metal-util.cpp
@@ -13,107 +13,189 @@ MTL::PixelFormat MetalUtil::translatePixelFormat(Format format)
{
switch (format)
{
- case Format::R32G32B32A32_TYPELESS: return MTL::PixelFormatRGBA32Float;
- case Format::R32G32B32_TYPELESS: return MTL::PixelFormatInvalid;
- case Format::R32G32_TYPELESS: return MTL::PixelFormatRG32Float;
- case Format::R32_TYPELESS: return MTL::PixelFormatR32Float;
-
- case Format::R16G16B16A16_TYPELESS: return MTL::PixelFormatRGBA16Float;
- case Format::R16G16_TYPELESS: return MTL::PixelFormatRG16Float;
- case Format::R16_TYPELESS: return MTL::PixelFormatR16Float;
-
- case Format::R8G8B8A8_TYPELESS: return MTL::PixelFormatRGBA8Unorm;
- case Format::R8G8_TYPELESS: return MTL::PixelFormatRG8Unorm;
- case Format::R8_TYPELESS: return MTL::PixelFormatR8Unorm;
- case Format::B8G8R8A8_TYPELESS: return MTL::PixelFormatBGRA8Unorm;
-
- case Format::R32G32B32A32_FLOAT: return MTL::PixelFormatRGBA32Float;
- case Format::R32G32B32_FLOAT: return MTL::PixelFormatInvalid;
- case Format::R32G32_FLOAT: return MTL::PixelFormatRG32Float;
- case Format::R32_FLOAT: return MTL::PixelFormatR32Float;
-
- case Format::R16G16B16A16_FLOAT: return MTL::PixelFormatRGBA16Float;
- case Format::R16G16_FLOAT: return MTL::PixelFormatRG16Float;
- case Format::R16_FLOAT: return MTL::PixelFormatR16Float;
-
- case Format::R32G32B32A32_UINT: return MTL::PixelFormatRGBA32Uint;
- case Format::R32G32B32_UINT: return MTL::PixelFormatInvalid;
- case Format::R32G32_UINT: return MTL::PixelFormatRG32Uint;
- case Format::R32_UINT: return MTL::PixelFormatR32Uint;
-
- case Format::R16G16B16A16_UINT: return MTL::PixelFormatRGBA16Uint;
- case Format::R16G16_UINT: return MTL::PixelFormatRG16Uint;
- case Format::R16_UINT: return MTL::PixelFormatR16Uint;
-
- case Format::R8G8B8A8_UINT: return MTL::PixelFormatRGBA8Uint;
- case Format::R8G8_UINT: return MTL::PixelFormatRG8Uint;
- case Format::R8_UINT: return MTL::PixelFormatR8Uint;
-
- case Format::R32G32B32A32_SINT: return MTL::PixelFormatRGBA32Sint;
- case Format::R32G32B32_SINT: return MTL::PixelFormatInvalid;
- case Format::R32G32_SINT: return MTL::PixelFormatRG32Sint;
- case Format::R32_SINT: return MTL::PixelFormatR32Sint;
-
- case Format::R16G16B16A16_SINT: return MTL::PixelFormatRGBA16Sint;
- case Format::R16G16_SINT: return MTL::PixelFormatRG16Sint;
- case Format::R16_SINT: return MTL::PixelFormatR16Sint;
-
- case Format::R8G8B8A8_SINT: return MTL::PixelFormatRGBA8Sint;
- case Format::R8G8_SINT: return MTL::PixelFormatRG8Sint;
- case Format::R8_SINT: return MTL::PixelFormatR8Sint;
-
- case Format::R16G16B16A16_UNORM: return MTL::PixelFormatRGBA16Unorm;
- case Format::R16G16_UNORM: return MTL::PixelFormatRG16Unorm;
- case Format::R16_UNORM: return MTL::PixelFormatR16Unorm;
-
- case Format::R8G8B8A8_UNORM: return MTL::PixelFormatRGBA8Unorm;
- case Format::R8G8B8A8_UNORM_SRGB: return MTL::PixelFormatRGBA8Unorm_sRGB;
- case Format::R8G8_UNORM: return MTL::PixelFormatRG8Unorm;
- case Format::R8_UNORM: return MTL::PixelFormatR8Unorm;
- case Format::B8G8R8A8_UNORM: return MTL::PixelFormatBGRA8Unorm;
- case Format::B8G8R8A8_UNORM_SRGB: return MTL::PixelFormatBGRA8Unorm_sRGB;
- case Format::B8G8R8X8_UNORM: return MTL::PixelFormatInvalid;
- case Format::B8G8R8X8_UNORM_SRGB: return MTL::PixelFormatInvalid;
-
- case Format::R16G16B16A16_SNORM: return MTL::PixelFormatRGBA16Snorm;
- case Format::R16G16_SNORM: return MTL::PixelFormatRG16Snorm;
- case Format::R16_SNORM: return MTL::PixelFormatR16Snorm;
-
- case Format::R8G8B8A8_SNORM: return MTL::PixelFormatRGBA8Snorm;
- case Format::R8G8_SNORM: return MTL::PixelFormatRG8Snorm;
- case Format::R8_SNORM: return MTL::PixelFormatR8Snorm;
-
- case Format::D32_FLOAT: return MTL::PixelFormatDepth32Float;
- case Format::D16_UNORM: return MTL::PixelFormatDepth16Unorm;
- case Format::D32_FLOAT_S8_UINT: return MTL::PixelFormatDepth32Float_Stencil8;
- case Format::R32_FLOAT_X32_TYPELESS: return MTL::PixelFormatInvalid;
-
- case Format::B4G4R4A4_UNORM: return MTL::PixelFormatABGR4Unorm;
- case Format::B5G6R5_UNORM: return MTL::PixelFormatB5G6R5Unorm;
- case Format::B5G5R5A1_UNORM: return MTL::PixelFormatA1BGR5Unorm;
-
- case Format::R9G9B9E5_SHAREDEXP: return MTL::PixelFormatRGB9E5Float;
- case Format::R10G10B10A2_TYPELESS: return MTL::PixelFormatInvalid;
- case Format::R10G10B10A2_UINT: return MTL::PixelFormatRGB10A2Uint;
- case Format::R10G10B10A2_UNORM: return MTL::PixelFormatRGB10A2Unorm;
- case Format::R11G11B10_FLOAT: return MTL::PixelFormatRG11B10Float;
-
- case Format::BC1_UNORM: return MTL::PixelFormatBC1_RGBA;
- case Format::BC1_UNORM_SRGB: return MTL::PixelFormatBC1_RGBA_sRGB;
- case Format::BC2_UNORM: return MTL::PixelFormatBC2_RGBA;
- case Format::BC2_UNORM_SRGB: return MTL::PixelFormatBC2_RGBA_sRGB;
- case Format::BC3_UNORM: return MTL::PixelFormatBC3_RGBA;
- case Format::BC3_UNORM_SRGB: return MTL::PixelFormatBC3_RGBA_sRGB;
- case Format::BC4_UNORM: return MTL::PixelFormatBC4_RUnorm;
- case Format::BC4_SNORM: return MTL::PixelFormatBC4_RSnorm;
- case Format::BC5_UNORM: return MTL::PixelFormatBC5_RGUnorm;
- case Format::BC5_SNORM: return MTL::PixelFormatBC5_RGSnorm;
- case Format::BC6H_UF16: return MTL::PixelFormatBC6H_RGBUfloat;
- case Format::BC6H_SF16: return MTL::PixelFormatBC6H_RGBFloat;
- case Format::BC7_UNORM: return MTL::PixelFormatBC7_RGBAUnorm;
- case Format::BC7_UNORM_SRGB: return MTL::PixelFormatBC7_RGBAUnorm_sRGB;
-
- default: return MTL::PixelFormatInvalid;
+ case Format::R32G32B32A32_TYPELESS:
+ return MTL::PixelFormatRGBA32Float;
+ case Format::R32G32B32_TYPELESS:
+ return MTL::PixelFormatInvalid;
+ case Format::R32G32_TYPELESS:
+ return MTL::PixelFormatRG32Float;
+ case Format::R32_TYPELESS:
+ return MTL::PixelFormatR32Float;
+
+ case Format::R16G16B16A16_TYPELESS:
+ return MTL::PixelFormatRGBA16Float;
+ case Format::R16G16_TYPELESS:
+ return MTL::PixelFormatRG16Float;
+ case Format::R16_TYPELESS:
+ return MTL::PixelFormatR16Float;
+
+ case Format::R8G8B8A8_TYPELESS:
+ return MTL::PixelFormatRGBA8Unorm;
+ case Format::R8G8_TYPELESS:
+ return MTL::PixelFormatRG8Unorm;
+ case Format::R8_TYPELESS:
+ return MTL::PixelFormatR8Unorm;
+ case Format::B8G8R8A8_TYPELESS:
+ return MTL::PixelFormatBGRA8Unorm;
+
+ case Format::R32G32B32A32_FLOAT:
+ return MTL::PixelFormatRGBA32Float;
+ case Format::R32G32B32_FLOAT:
+ return MTL::PixelFormatInvalid;
+ case Format::R32G32_FLOAT:
+ return MTL::PixelFormatRG32Float;
+ case Format::R32_FLOAT:
+ return MTL::PixelFormatR32Float;
+
+ case Format::R16G16B16A16_FLOAT:
+ return MTL::PixelFormatRGBA16Float;
+ case Format::R16G16_FLOAT:
+ return MTL::PixelFormatRG16Float;
+ case Format::R16_FLOAT:
+ return MTL::PixelFormatR16Float;
+
+ case Format::R32G32B32A32_UINT:
+ return MTL::PixelFormatRGBA32Uint;
+ case Format::R32G32B32_UINT:
+ return MTL::PixelFormatInvalid;
+ case Format::R32G32_UINT:
+ return MTL::PixelFormatRG32Uint;
+ case Format::R32_UINT:
+ return MTL::PixelFormatR32Uint;
+
+ case Format::R16G16B16A16_UINT:
+ return MTL::PixelFormatRGBA16Uint;
+ case Format::R16G16_UINT:
+ return MTL::PixelFormatRG16Uint;
+ case Format::R16_UINT:
+ return MTL::PixelFormatR16Uint;
+
+ case Format::R8G8B8A8_UINT:
+ return MTL::PixelFormatRGBA8Uint;
+ case Format::R8G8_UINT:
+ return MTL::PixelFormatRG8Uint;
+ case Format::R8_UINT:
+ return MTL::PixelFormatR8Uint;
+
+ case Format::R32G32B32A32_SINT:
+ return MTL::PixelFormatRGBA32Sint;
+ case Format::R32G32B32_SINT:
+ return MTL::PixelFormatInvalid;
+ case Format::R32G32_SINT:
+ return MTL::PixelFormatRG32Sint;
+ case Format::R32_SINT:
+ return MTL::PixelFormatR32Sint;
+
+ case Format::R16G16B16A16_SINT:
+ return MTL::PixelFormatRGBA16Sint;
+ case Format::R16G16_SINT:
+ return MTL::PixelFormatRG16Sint;
+ case Format::R16_SINT:
+ return MTL::PixelFormatR16Sint;
+
+ case Format::R8G8B8A8_SINT:
+ return MTL::PixelFormatRGBA8Sint;
+ case Format::R8G8_SINT:
+ return MTL::PixelFormatRG8Sint;
+ case Format::R8_SINT:
+ return MTL::PixelFormatR8Sint;
+
+ case Format::R16G16B16A16_UNORM:
+ return MTL::PixelFormatRGBA16Unorm;
+ case Format::R16G16_UNORM:
+ return MTL::PixelFormatRG16Unorm;
+ case Format::R16_UNORM:
+ return MTL::PixelFormatR16Unorm;
+
+ case Format::R8G8B8A8_UNORM:
+ return MTL::PixelFormatRGBA8Unorm;
+ case Format::R8G8B8A8_UNORM_SRGB:
+ return MTL::PixelFormatRGBA8Unorm_sRGB;
+ case Format::R8G8_UNORM:
+ return MTL::PixelFormatRG8Unorm;
+ case Format::R8_UNORM:
+ return MTL::PixelFormatR8Unorm;
+ case Format::B8G8R8A8_UNORM:
+ return MTL::PixelFormatBGRA8Unorm;
+ case Format::B8G8R8A8_UNORM_SRGB:
+ return MTL::PixelFormatBGRA8Unorm_sRGB;
+ case Format::B8G8R8X8_UNORM:
+ return MTL::PixelFormatInvalid;
+ case Format::B8G8R8X8_UNORM_SRGB:
+ return MTL::PixelFormatInvalid;
+
+ case Format::R16G16B16A16_SNORM:
+ return MTL::PixelFormatRGBA16Snorm;
+ case Format::R16G16_SNORM:
+ return MTL::PixelFormatRG16Snorm;
+ case Format::R16_SNORM:
+ return MTL::PixelFormatR16Snorm;
+
+ case Format::R8G8B8A8_SNORM:
+ return MTL::PixelFormatRGBA8Snorm;
+ case Format::R8G8_SNORM:
+ return MTL::PixelFormatRG8Snorm;
+ case Format::R8_SNORM:
+ return MTL::PixelFormatR8Snorm;
+
+ case Format::D32_FLOAT:
+ return MTL::PixelFormatDepth32Float;
+ case Format::D16_UNORM:
+ return MTL::PixelFormatDepth16Unorm;
+ case Format::D32_FLOAT_S8_UINT:
+ return MTL::PixelFormatDepth32Float_Stencil8;
+ case Format::R32_FLOAT_X32_TYPELESS:
+ return MTL::PixelFormatInvalid;
+
+ case Format::B4G4R4A4_UNORM:
+ return MTL::PixelFormatABGR4Unorm;
+ case Format::B5G6R5_UNORM:
+ return MTL::PixelFormatB5G6R5Unorm;
+ case Format::B5G5R5A1_UNORM:
+ return MTL::PixelFormatA1BGR5Unorm;
+
+ case Format::R9G9B9E5_SHAREDEXP:
+ return MTL::PixelFormatRGB9E5Float;
+ case Format::R10G10B10A2_TYPELESS:
+ return MTL::PixelFormatInvalid;
+ case Format::R10G10B10A2_UINT:
+ return MTL::PixelFormatRGB10A2Uint;
+ case Format::R10G10B10A2_UNORM:
+ return MTL::PixelFormatRGB10A2Unorm;
+ case Format::R11G11B10_FLOAT:
+ return MTL::PixelFormatRG11B10Float;
+
+ case Format::BC1_UNORM:
+ return MTL::PixelFormatBC1_RGBA;
+ case Format::BC1_UNORM_SRGB:
+ return MTL::PixelFormatBC1_RGBA_sRGB;
+ case Format::BC2_UNORM:
+ return MTL::PixelFormatBC2_RGBA;
+ case Format::BC2_UNORM_SRGB:
+ return MTL::PixelFormatBC2_RGBA_sRGB;
+ case Format::BC3_UNORM:
+ return MTL::PixelFormatBC3_RGBA;
+ case Format::BC3_UNORM_SRGB:
+ return MTL::PixelFormatBC3_RGBA_sRGB;
+ case Format::BC4_UNORM:
+ return MTL::PixelFormatBC4_RUnorm;
+ case Format::BC4_SNORM:
+ return MTL::PixelFormatBC4_RSnorm;
+ case Format::BC5_UNORM:
+ return MTL::PixelFormatBC5_RGUnorm;
+ case Format::BC5_SNORM:
+ return MTL::PixelFormatBC5_RGSnorm;
+ case Format::BC6H_UF16:
+ return MTL::PixelFormatBC6H_RGBUfloat;
+ case Format::BC6H_SF16:
+ return MTL::PixelFormatBC6H_RGBFloat;
+ case Format::BC7_UNORM:
+ return MTL::PixelFormatBC7_RGBAUnorm;
+ case Format::BC7_UNORM_SRGB:
+ return MTL::PixelFormatBC7_RGBAUnorm_sRGB;
+
+ default:
+ return MTL::PixelFormatInvalid;
}
}
@@ -121,60 +203,104 @@ MTL::VertexFormat MetalUtil::translateVertexFormat(Format format)
{
switch (format)
{
- case Format::R8G8_UINT: return MTL::VertexFormatUChar2;
+ case Format::R8G8_UINT:
+ return MTL::VertexFormatUChar2;
// VertexFormatUChar3
- case Format::R8G8B8A8_UINT: return MTL::VertexFormatUChar4;
- case Format::R8G8_SINT: return MTL::VertexFormatChar2;
+ case Format::R8G8B8A8_UINT:
+ return MTL::VertexFormatUChar4;
+ case Format::R8G8_SINT:
+ return MTL::VertexFormatChar2;
// return VertexFormatChar3
- case Format::R8G8B8A8_SINT: return MTL::VertexFormatChar4;
- case Format::R8G8_UNORM: return MTL::VertexFormatUChar2Normalized;
+ case Format::R8G8B8A8_SINT:
+ return MTL::VertexFormatChar4;
+ case Format::R8G8_UNORM:
+ return MTL::VertexFormatUChar2Normalized;
// return VertexFormatUChar3Normalized;
- case Format::R8G8B8A8_UNORM: return MTL::VertexFormatUChar4Normalized;
- case Format::R8G8_SNORM: return MTL::VertexFormatChar2Normalized;
+ case Format::R8G8B8A8_UNORM:
+ return MTL::VertexFormatUChar4Normalized;
+ case Format::R8G8_SNORM:
+ return MTL::VertexFormatChar2Normalized;
// return VertexFormatChar3Normalized
- case Format::R8G8B8A8_SNORM: return MTL::VertexFormatChar4Normalized;
- case Format::R16G16_UINT: return MTL::VertexFormatUShort2;
+ case Format::R8G8B8A8_SNORM:
+ return MTL::VertexFormatChar4Normalized;
+ case Format::R16G16_UINT:
+ return MTL::VertexFormatUShort2;
// return VertexFormatUShort3;
- case Format::R16G16B16A16_UINT: return MTL::VertexFormatUShort4;
- case Format::R16G16_SINT: return MTL::VertexFormatShort2;
+ case Format::R16G16B16A16_UINT:
+ return MTL::VertexFormatUShort4;
+ case Format::R16G16_SINT:
+ return MTL::VertexFormatShort2;
// return VertexFormatShort3;
- case Format::R16G16B16A16_SINT: return MTL::VertexFormatShort4;
- case Format::R16G16_UNORM: return MTL::VertexFormatUShort2Normalized;
+ case Format::R16G16B16A16_SINT:
+ return MTL::VertexFormatShort4;
+ case Format::R16G16_UNORM:
+ return MTL::VertexFormatUShort2Normalized;
// return VertexFormatUShort3Normalized;
- case Format::R16G16B16A16_UNORM: return MTL::VertexFormatUShort4Normalized;
- case Format::R16G16_SNORM: return MTL::VertexFormatShort2Normalized;
+ case Format::R16G16B16A16_UNORM:
+ return MTL::VertexFormatUShort4Normalized;
+ case Format::R16G16_SNORM:
+ return MTL::VertexFormatShort2Normalized;
// return VertexFormatShort3Normalized;
- case Format::R16G16B16A16_SNORM: return MTL::VertexFormatShort4Normalized;
- case Format::R16G16_FLOAT: return MTL::VertexFormatHalf2;
+ case Format::R16G16B16A16_SNORM:
+ return MTL::VertexFormatShort4Normalized;
+ case Format::R16G16_FLOAT:
+ return MTL::VertexFormatHalf2;
// return VertexFormatHalf3;
- case Format::R16G16B16A16_FLOAT: return MTL::VertexFormatHalf4;
- case Format::R32_FLOAT: return MTL::VertexFormatFloat;
- case Format::R32G32_FLOAT: return MTL::VertexFormatFloat2;
- case Format::R32G32B32_FLOAT: return MTL::VertexFormatFloat3;
- case Format::R32G32B32A32_FLOAT: return MTL::VertexFormatFloat4;
- case Format::R32_SINT: return MTL::VertexFormatInt;
- case Format::R32G32_SINT: return MTL::VertexFormatInt2;
- case Format::R32G32B32_SINT: return MTL::VertexFormatInt3;
- case Format::R32G32B32A32_SINT: return MTL::VertexFormatInt4;
- case Format::R32_UINT: return MTL::VertexFormatUInt;
- case Format::R32G32_UINT: return MTL::VertexFormatUInt2;
- case Format::R32G32B32_UINT: return MTL::VertexFormatUInt3;
- case Format::R32G32B32A32_UINT: return MTL::VertexFormatUInt4;
+ case Format::R16G16B16A16_FLOAT:
+ return MTL::VertexFormatHalf4;
+ case Format::R32_FLOAT:
+ return MTL::VertexFormatFloat;
+ case Format::R32G32_FLOAT:
+ return MTL::VertexFormatFloat2;
+ case Format::R32G32B32_FLOAT:
+ return MTL::VertexFormatFloat3;
+ case Format::R32G32B32A32_FLOAT:
+ return MTL::VertexFormatFloat4;
+ case Format::R32_SINT:
+ return MTL::VertexFormatInt;
+ case Format::R32G32_SINT:
+ return MTL::VertexFormatInt2;
+ case Format::R32G32B32_SINT:
+ return MTL::VertexFormatInt3;
+ case Format::R32G32B32A32_SINT:
+ return MTL::VertexFormatInt4;
+ case Format::R32_UINT:
+ return MTL::VertexFormatUInt;
+ case Format::R32G32_UINT:
+ return MTL::VertexFormatUInt2;
+ case Format::R32G32B32_UINT:
+ return MTL::VertexFormatUInt3;
+ case Format::R32G32B32A32_UINT:
+ return MTL::VertexFormatUInt4;
// return VertexFormatInt1010102Normalized;
- case Format::R10G10B10A2_UNORM: return MTL::VertexFormatUInt1010102Normalized;
- case Format::B4G4R4A4_UNORM: return MTL::VertexFormatUChar4Normalized_BGRA;
- case Format::R8_UINT: return MTL::VertexFormatUChar;
- case Format::R8_SINT: return MTL::VertexFormatChar;
- case Format::R8_UNORM: return MTL::VertexFormatUCharNormalized;
- case Format::R8_SNORM: return MTL::VertexFormatCharNormalized;
- case Format::R16_UINT: return MTL::VertexFormatUShort;
- case Format::R16_SINT: return MTL::VertexFormatShort;
- case Format::R16_UNORM: return MTL::VertexFormatUShortNormalized;
- case Format::R16_SNORM: return MTL::VertexFormatShortNormalized;
- case Format::R16_FLOAT: return MTL::VertexFormatHalf;
- case Format::R11G11B10_FLOAT: return MTL::VertexFormatFloatRG11B10;
- case Format::R9G9B9E5_SHAREDEXP: return MTL::VertexFormatFloatRGB9E5;
- default: return MTL::VertexFormatInvalid;
+ case Format::R10G10B10A2_UNORM:
+ return MTL::VertexFormatUInt1010102Normalized;
+ case Format::B4G4R4A4_UNORM:
+ return MTL::VertexFormatUChar4Normalized_BGRA;
+ case Format::R8_UINT:
+ return MTL::VertexFormatUChar;
+ case Format::R8_SINT:
+ return MTL::VertexFormatChar;
+ case Format::R8_UNORM:
+ return MTL::VertexFormatUCharNormalized;
+ case Format::R8_SNORM:
+ return MTL::VertexFormatCharNormalized;
+ case Format::R16_UINT:
+ return MTL::VertexFormatUShort;
+ case Format::R16_SINT:
+ return MTL::VertexFormatShort;
+ case Format::R16_UNORM:
+ return MTL::VertexFormatUShortNormalized;
+ case Format::R16_SNORM:
+ return MTL::VertexFormatShortNormalized;
+ case Format::R16_FLOAT:
+ return MTL::VertexFormatHalf;
+ case Format::R11G11B10_FLOAT:
+ return MTL::VertexFormatFloatRG11B10;
+ case Format::R9G9B9E5_SHAREDEXP:
+ return MTL::VertexFormatFloatRGB9E5;
+ default:
+ return MTL::VertexFormatInvalid;
}
}
@@ -185,8 +311,10 @@ bool MetalUtil::isDepthFormat(MTL::PixelFormat format)
case MTL::PixelFormatDepth16Unorm:
case MTL::PixelFormatDepth32Float:
case MTL::PixelFormatDepth24Unorm_Stencil8:
- case MTL::PixelFormatDepth32Float_Stencil8: return true;
- default: return false;
+ case MTL::PixelFormatDepth32Float_Stencil8:
+ return true;
+ default:
+ return false;
}
}
@@ -198,8 +326,10 @@ bool MetalUtil::isStencilFormat(MTL::PixelFormat format)
case MTL::PixelFormatDepth24Unorm_Stencil8:
case MTL::PixelFormatDepth32Float_Stencil8:
case MTL::PixelFormatX32_Stencil8:
- case MTL::PixelFormatX24_Stencil8: return true;
- default: return false;
+ case MTL::PixelFormatX24_Stencil8:
+ return true;
+ default:
+ return false;
}
}
@@ -207,9 +337,12 @@ MTL::SamplerMinMagFilter MetalUtil::translateSamplerMinMagFilter(TextureFilterin
{
switch (mode)
{
- case TextureFilteringMode::Point: return MTL::SamplerMinMagFilterNearest;
- case TextureFilteringMode::Linear: return MTL::SamplerMinMagFilterLinear;
- default: return MTL::SamplerMinMagFilter(0);
+ case TextureFilteringMode::Point:
+ return MTL::SamplerMinMagFilterNearest;
+ case TextureFilteringMode::Linear:
+ return MTL::SamplerMinMagFilterLinear;
+ default:
+ return MTL::SamplerMinMagFilter(0);
}
}
@@ -217,9 +350,12 @@ MTL::SamplerMipFilter MetalUtil::translateSamplerMipFilter(TextureFilteringMode
{
switch (mode)
{
- case TextureFilteringMode::Point: return MTL::SamplerMipFilterNearest;
- case TextureFilteringMode::Linear: return MTL::SamplerMipFilterLinear;
- default: return MTL::SamplerMipFilter(0);
+ case TextureFilteringMode::Point:
+ return MTL::SamplerMipFilterNearest;
+ case TextureFilteringMode::Linear:
+ return MTL::SamplerMipFilterLinear;
+ default:
+ return MTL::SamplerMipFilter(0);
}
}
@@ -227,12 +363,18 @@ MTL::SamplerAddressMode MetalUtil::translateSamplerAddressMode(TextureAddressing
{
switch (mode)
{
- case TextureAddressingMode::Wrap: return MTL::SamplerAddressModeRepeat;
- case TextureAddressingMode::ClampToEdge: return MTL::SamplerAddressModeClampToEdge;
- case TextureAddressingMode::ClampToBorder: return MTL::SamplerAddressModeClampToBorderColor;
- case TextureAddressingMode::MirrorRepeat: return MTL::SamplerAddressModeMirrorRepeat;
- case TextureAddressingMode::MirrorOnce: return MTL::SamplerAddressModeMirrorClampToEdge;
- default: return MTL::SamplerAddressMode(0);
+ case TextureAddressingMode::Wrap:
+ return MTL::SamplerAddressModeRepeat;
+ case TextureAddressingMode::ClampToEdge:
+ return MTL::SamplerAddressModeClampToEdge;
+ case TextureAddressingMode::ClampToBorder:
+ return MTL::SamplerAddressModeClampToBorderColor;
+ case TextureAddressingMode::MirrorRepeat:
+ return MTL::SamplerAddressModeMirrorRepeat;
+ case TextureAddressingMode::MirrorOnce:
+ return MTL::SamplerAddressModeMirrorClampToEdge;
+ default:
+ return MTL::SamplerAddressMode(0);
}
}
@@ -240,15 +382,24 @@ MTL::CompareFunction MetalUtil::translateCompareFunction(ComparisonFunc func)
{
switch (func)
{
- case ComparisonFunc::Never: return MTL::CompareFunctionNever;
- case ComparisonFunc::Less: return MTL::CompareFunctionLess;
- case ComparisonFunc::Equal: return MTL::CompareFunctionEqual;
- case ComparisonFunc::LessEqual: return MTL::CompareFunctionLessEqual;
- case ComparisonFunc::Greater: return MTL::CompareFunctionGreater;
- case ComparisonFunc::NotEqual: return MTL::CompareFunctionNotEqual;
- case ComparisonFunc::GreaterEqual: return MTL::CompareFunctionGreaterEqual;
- case ComparisonFunc::Always: return MTL::CompareFunctionAlways;
- default: return MTL::CompareFunction(0);
+ case ComparisonFunc::Never:
+ return MTL::CompareFunctionNever;
+ case ComparisonFunc::Less:
+ return MTL::CompareFunctionLess;
+ case ComparisonFunc::Equal:
+ return MTL::CompareFunctionEqual;
+ case ComparisonFunc::LessEqual:
+ return MTL::CompareFunctionLessEqual;
+ case ComparisonFunc::Greater:
+ return MTL::CompareFunctionGreater;
+ case ComparisonFunc::NotEqual:
+ return MTL::CompareFunctionNotEqual;
+ case ComparisonFunc::GreaterEqual:
+ return MTL::CompareFunctionGreaterEqual;
+ case ComparisonFunc::Always:
+ return MTL::CompareFunctionAlways;
+ default:
+ return MTL::CompareFunction(0);
}
}
@@ -256,15 +407,24 @@ MTL::StencilOperation MetalUtil::translateStencilOperation(StencilOp op)
{
switch (op)
{
- case StencilOp::Keep: return MTL::StencilOperationKeep;
- case StencilOp::Zero: return MTL::StencilOperationZero;
- case StencilOp::Replace: return MTL::StencilOperationReplace;
- case StencilOp::IncrementSaturate: return MTL::StencilOperationIncrementClamp;
- case StencilOp::DecrementSaturate: return MTL::StencilOperationDecrementClamp;
- case StencilOp::Invert: return MTL::StencilOperationInvert;
- case StencilOp::IncrementWrap: return MTL::StencilOperationIncrementWrap;
- case StencilOp::DecrementWrap: return MTL::StencilOperationDecrementWrap;
- default: return MTL::StencilOperation(0);
+ case StencilOp::Keep:
+ return MTL::StencilOperationKeep;
+ case StencilOp::Zero:
+ return MTL::StencilOperationZero;
+ case StencilOp::Replace:
+ return MTL::StencilOperationReplace;
+ case StencilOp::IncrementSaturate:
+ return MTL::StencilOperationIncrementClamp;
+ case StencilOp::DecrementSaturate:
+ return MTL::StencilOperationDecrementClamp;
+ case StencilOp::Invert:
+ return MTL::StencilOperationInvert;
+ case StencilOp::IncrementWrap:
+ return MTL::StencilOperationIncrementWrap;
+ case StencilOp::DecrementWrap:
+ return MTL::StencilOperationDecrementWrap;
+ default:
+ return MTL::StencilOperation(0);
}
}
@@ -272,9 +432,12 @@ MTL::VertexStepFunction MetalUtil::translateVertexStepFunction(InputSlotClass sl
{
switch (slotClass)
{
- case InputSlotClass::PerVertex: return MTL::VertexStepFunctionPerVertex;
- case InputSlotClass::PerInstance: return MTL::VertexStepFunctionPerInstance;
- default: return MTL::VertexStepFunctionPerVertex;
+ case InputSlotClass::PerVertex:
+ return MTL::VertexStepFunctionPerVertex;
+ case InputSlotClass::PerInstance:
+ return MTL::VertexStepFunctionPerInstance;
+ default:
+ return MTL::VertexStepFunctionPerVertex;
}
}
@@ -282,12 +445,18 @@ MTL::PrimitiveType MetalUtil::translatePrimitiveType(PrimitiveTopology topology)
{
switch (topology)
{
- case PrimitiveTopology::TriangleList: return MTL::PrimitiveTypeTriangle;
- case PrimitiveTopology::TriangleStrip: return MTL::PrimitiveTypeTriangleStrip;
- case PrimitiveTopology::PointList: return MTL::PrimitiveTypePoint;
- case PrimitiveTopology::LineList: return MTL::PrimitiveTypeLine;
- case PrimitiveTopology::LineStrip: return MTL::PrimitiveTypeLineStrip;
- default: return MTL::PrimitiveType(0);
+ case PrimitiveTopology::TriangleList:
+ return MTL::PrimitiveTypeTriangle;
+ case PrimitiveTopology::TriangleStrip:
+ return MTL::PrimitiveTypeTriangleStrip;
+ case PrimitiveTopology::PointList:
+ return MTL::PrimitiveTypePoint;
+ case PrimitiveTopology::LineList:
+ return MTL::PrimitiveTypeLine;
+ case PrimitiveTopology::LineStrip:
+ return MTL::PrimitiveTypeLineStrip;
+ default:
+ return MTL::PrimitiveType(0);
}
}
@@ -295,11 +464,15 @@ MTL::PrimitiveTopologyClass MetalUtil::translatePrimitiveTopologyClass(Primitive
{
switch (type)
{
- case PrimitiveType::Point: return MTL::PrimitiveTopologyClassPoint;
- case PrimitiveType::Line: return MTL::PrimitiveTopologyClassLine;
- case PrimitiveType::Triangle: return MTL::PrimitiveTopologyClassTriangle;
+ case PrimitiveType::Point:
+ return MTL::PrimitiveTopologyClassPoint;
+ case PrimitiveType::Line:
+ return MTL::PrimitiveTopologyClassLine;
+ case PrimitiveType::Triangle:
+ return MTL::PrimitiveTopologyClassTriangle;
case PrimitiveType::Patch:
- default: return MTL::PrimitiveTopologyClassUnspecified;
+ default:
+ return MTL::PrimitiveTopologyClassUnspecified;
}
}
@@ -307,24 +480,42 @@ MTL::BlendFactor MetalUtil::translateBlendFactor(BlendFactor factor)
{
switch (factor)
{
- case BlendFactor::Zero: return MTL::BlendFactorZero;
- case BlendFactor::One: return MTL::BlendFactorOne;
- case BlendFactor::SrcColor: return MTL::BlendFactorSourceColor;
- case BlendFactor::InvSrcColor: return MTL::BlendFactorOneMinusSourceColor;
- case BlendFactor::SrcAlpha: return MTL::BlendFactorSourceAlpha;
- case BlendFactor::InvSrcAlpha: return MTL::BlendFactorOneMinusSourceAlpha;
- case BlendFactor::DestAlpha: return MTL::BlendFactorDestinationAlpha;
- case BlendFactor::InvDestAlpha: return MTL::BlendFactorOneMinusDestinationAlpha;
- case BlendFactor::DestColor: return MTL::BlendFactorDestinationColor;
- case BlendFactor::InvDestColor: return MTL::BlendFactorOneMinusDestinationColor;
- case BlendFactor::SrcAlphaSaturate: return MTL::BlendFactorSourceAlphaSaturated;
- case BlendFactor::BlendColor: return MTL::BlendFactorBlendColor;
- case BlendFactor::InvBlendColor: return MTL::BlendFactorOneMinusBlendColor;
- case BlendFactor::SecondarySrcColor: return MTL::BlendFactorSource1Color;
- case BlendFactor::InvSecondarySrcColor: return MTL::BlendFactorOneMinusSource1Color;
- case BlendFactor::SecondarySrcAlpha: return MTL::BlendFactorSource1Alpha;
- case BlendFactor::InvSecondarySrcAlpha: return MTL::BlendFactorOneMinusSource1Alpha;
- default: return MTL::BlendFactor(0);
+ case BlendFactor::Zero:
+ return MTL::BlendFactorZero;
+ case BlendFactor::One:
+ return MTL::BlendFactorOne;
+ case BlendFactor::SrcColor:
+ return MTL::BlendFactorSourceColor;
+ case BlendFactor::InvSrcColor:
+ return MTL::BlendFactorOneMinusSourceColor;
+ case BlendFactor::SrcAlpha:
+ return MTL::BlendFactorSourceAlpha;
+ case BlendFactor::InvSrcAlpha:
+ return MTL::BlendFactorOneMinusSourceAlpha;
+ case BlendFactor::DestAlpha:
+ return MTL::BlendFactorDestinationAlpha;
+ case BlendFactor::InvDestAlpha:
+ return MTL::BlendFactorOneMinusDestinationAlpha;
+ case BlendFactor::DestColor:
+ return MTL::BlendFactorDestinationColor;
+ case BlendFactor::InvDestColor:
+ return MTL::BlendFactorOneMinusDestinationColor;
+ case BlendFactor::SrcAlphaSaturate:
+ return MTL::BlendFactorSourceAlphaSaturated;
+ case BlendFactor::BlendColor:
+ return MTL::BlendFactorBlendColor;
+ case BlendFactor::InvBlendColor:
+ return MTL::BlendFactorOneMinusBlendColor;
+ case BlendFactor::SecondarySrcColor:
+ return MTL::BlendFactorSource1Color;
+ case BlendFactor::InvSecondarySrcColor:
+ return MTL::BlendFactorOneMinusSource1Color;
+ case BlendFactor::SecondarySrcAlpha:
+ return MTL::BlendFactorSource1Alpha;
+ case BlendFactor::InvSecondarySrcAlpha:
+ return MTL::BlendFactorOneMinusSource1Alpha;
+ default:
+ return MTL::BlendFactor(0);
}
}
@@ -332,12 +523,18 @@ MTL::BlendOperation MetalUtil::translateBlendOperation(BlendOp op)
{
switch (op)
{
- case BlendOp::Add: return MTL::BlendOperationAdd;
- case BlendOp::Subtract: return MTL::BlendOperationSubtract;
- case BlendOp::ReverseSubtract: return MTL::BlendOperationReverseSubtract;
- case BlendOp::Min: return MTL::BlendOperationMin;
- case BlendOp::Max: return MTL::BlendOperationMax;
- default: return MTL::BlendOperation(0);
+ case BlendOp::Add:
+ return MTL::BlendOperationAdd;
+ case BlendOp::Subtract:
+ return MTL::BlendOperationSubtract;
+ case BlendOp::ReverseSubtract:
+ return MTL::BlendOperationReverseSubtract;
+ case BlendOp::Min:
+ return MTL::BlendOperationMin;
+ case BlendOp::Max:
+ return MTL::BlendOperationMax;
+ default:
+ return MTL::BlendOperation(0);
}
}
@@ -359,9 +556,12 @@ MTL::Winding MetalUtil::translateWinding(FrontFaceMode mode)
{
switch (mode)
{
- case FrontFaceMode::CounterClockwise: return MTL::WindingCounterClockwise;
- case FrontFaceMode::Clockwise: return MTL::WindingClockwise;
- default: return MTL::Winding(0);
+ case FrontFaceMode::CounterClockwise:
+ return MTL::WindingCounterClockwise;
+ case FrontFaceMode::Clockwise:
+ return MTL::WindingClockwise;
+ default:
+ return MTL::Winding(0);
}
}
@@ -369,10 +569,14 @@ MTL::CullMode MetalUtil::translateCullMode(CullMode mode)
{
switch (mode)
{
- case CullMode::None: return MTL::CullModeNone;
- case CullMode::Front: return MTL::CullModeFront;
- case CullMode::Back: return MTL::CullModeBack;
- default: return MTL::CullMode(0);
+ case CullMode::None:
+ return MTL::CullModeNone;
+ case CullMode::Front:
+ return MTL::CullModeFront;
+ case CullMode::Back:
+ return MTL::CullModeBack;
+ default:
+ return MTL::CullMode(0);
}
}
@@ -380,9 +584,12 @@ MTL::TriangleFillMode MetalUtil::translateTriangleFillMode(FillMode mode)
{
switch (mode)
{
- case FillMode::Solid: return MTL::TriangleFillModeFill;
- case FillMode::Wireframe: return MTL::TriangleFillModeLines;
- default: return MTL::TriangleFillMode(0);
+ case FillMode::Solid:
+ return MTL::TriangleFillModeFill;
+ case FillMode::Wireframe:
+ return MTL::TriangleFillModeLines;
+ default:
+ return MTL::TriangleFillMode(0);
}
}