summaryrefslogtreecommitdiff
path: root/tools/gfx/metal/metal-render-pass.cpp
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-10-29 14:49:26 +0800
committerGitHub <noreply@github.com>2024-10-29 14:49:26 +0800
commitf65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch)
treeea1d61342cd29368e19135000ec2948813096205 /tools/gfx/metal/metal-render-pass.cpp
parenta729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff)
format
* format * Minor test fixes * enable checking cpp format in ci
Diffstat (limited to 'tools/gfx/metal/metal-render-pass.cpp')
-rw-r--r--tools/gfx/metal/metal-render-pass.cpp44
1 files changed, 22 insertions, 22 deletions
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<FramebufferLayoutImpl*>(desc.framebufferLayout);
+ FramebufferLayoutImpl* framebufferLayout =
+ static_cast<FramebufferLayoutImpl*>(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;
}