summaryrefslogtreecommitdiff
path: root/tools/gfx/metal/metal-device.cpp
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/metal-device.cpp
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/metal-device.cpp')
-rw-r--r--tools/gfx/metal/metal-device.cpp24
1 files changed, 18 insertions, 6 deletions
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