From b118451e301d734e3e783b3acdf871f3f6ea851c Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Wed, 6 Nov 2024 01:47:26 +0800 Subject: Move switch statement bodies to their own lines (#5493) * Move switch statement bodies to their own lines * format --------- Co-authored-by: Yong He --- tools/gfx/metal/metal-device.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'tools/gfx/metal/metal-device.cpp') 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 -- cgit v1.2.3