From f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 29 Oct 2024 14:49:26 +0800 Subject: format * format * Minor test fixes * enable checking cpp format in ci --- tools/gfx/metal/metal-render-pass.cpp | 44 +++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'tools/gfx/metal/metal-render-pass.cpp') diff --git a/tools/gfx/metal/metal-render-pass.cpp b/tools/gfx/metal/metal-render-pass.cpp index bc60cf746..49e470028 100644 --- a/tools/gfx/metal/metal-render-pass.cpp +++ b/tools/gfx/metal/metal-render-pass.cpp @@ -1,7 +1,7 @@ // metal-render-pass.cpp #include "metal-render-pass.h" -//#include "metal-helper-functions.h" +// #include "metal-helper-functions.h" namespace gfx { @@ -22,14 +22,10 @@ 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); } } @@ -37,12 +33,9 @@ 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); } } @@ -50,25 +43,32 @@ Result RenderPassLayoutImpl::init(DeviceImpl* device, const IRenderPassLayout::D { m_device = device; - FramebufferLayoutImpl* framebufferLayout = static_cast(desc.framebufferLayout); + FramebufferLayoutImpl* framebufferLayout = + static_cast(desc.framebufferLayout); assert(framebufferLayout); - // Initialize render pass descriptor, filling in attachment metadata, but leaving texture data unbound. + // Initialize render pass descriptor, filling in attachment metadata, but leaving texture data + // unbound. m_renderPassDesc = NS::TransferPtr(MTL::RenderPassDescriptor::alloc()->init()); m_renderPassDesc->setRenderTargetArrayLength(desc.renderTargetCount); for (GfxIndex i = 0; i < desc.renderTargetCount; ++i) { - MTL::RenderPassColorAttachmentDescriptor* colorAttachment = m_renderPassDesc->colorAttachments()->object(i); + MTL::RenderPassColorAttachmentDescriptor* colorAttachment = + m_renderPassDesc->colorAttachments()->object(i); colorAttachment->setLoadAction(translateLoadOp(desc.renderTargetAccess[i].loadOp)); colorAttachment->setStoreAction(translateStoreOp(desc.renderTargetAccess[i].storeOp)); } - m_renderPassDesc->depthAttachment()->setLoadAction(translateLoadOp(desc.depthStencilAccess->loadOp)); - m_renderPassDesc->depthAttachment()->setStoreAction(translateStoreOp(desc.depthStencilAccess->storeOp)); + m_renderPassDesc->depthAttachment()->setLoadAction( + translateLoadOp(desc.depthStencilAccess->loadOp)); + m_renderPassDesc->depthAttachment()->setStoreAction( + translateStoreOp(desc.depthStencilAccess->storeOp)); - m_renderPassDesc->stencilAttachment()->setLoadAction(translateLoadOp(desc.depthStencilAccess->loadOp)); - m_renderPassDesc->stencilAttachment()->setStoreAction(translateStoreOp(desc.depthStencilAccess->storeOp)); + m_renderPassDesc->stencilAttachment()->setLoadAction( + translateLoadOp(desc.depthStencilAccess->loadOp)); + m_renderPassDesc->stencilAttachment()->setStoreAction( + translateStoreOp(desc.depthStencilAccess->storeOp)); return SLANG_OK; } -- cgit v1.2.3