Skip to content

Commit

Permalink
release attachment descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
SamoZ256 committed Jul 7, 2024
1 parent 23af64a commit 6b108e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/renderer_mtl/renderer_mtl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class RendererMTL final : public Renderer {
setClearData(attachment, clearData);
attachment->setLoadAction(MTL::LoadActionClear);
attachment->setStoreAction(MTL::StoreActionStore);
attachment->release();

if (beginRenderPass) {
if (std::is_same<AttachmentT, MTL::RenderPassColorAttachmentDescriptor>::value)
Expand All @@ -153,6 +154,7 @@ class RendererMTL final : public Renderer {
attachment->setTexture(texture);
attachment->setLoadAction(MTL::LoadActionLoad);
attachment->setStoreAction(MTL::StoreActionStore);
attachment->release();
}

return false;
Expand Down
3 changes: 3 additions & 0 deletions src/core/renderer_mtl/renderer_mtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ void RendererMTL::display() {
colorAttachment->setLoadAction(MTL::LoadActionClear);
colorAttachment->setClearColor(MTL::ClearColor{0.0f, 0.0f, 0.0f, 1.0f});
colorAttachment->setStoreAction(MTL::StoreActionStore);
colorAttachment->release();

nextRenderPassName = "Display";
beginRenderPassIfNeeded(renderPassDescriptor, false, drawable->texture());
Expand Down Expand Up @@ -369,6 +370,7 @@ void RendererMTL::displayTransfer(u32 inputAddr, u32 outputAddr, u32 inputSize,
colorAttachment->setLoadAction(MTL::LoadActionClear);
colorAttachment->setClearColor(MTL::ClearColor{0.0, 0.0, 0.0, 1.0});
colorAttachment->setStoreAction(MTL::StoreActionStore);
colorAttachment->release();

// Pipeline
Metal::BlitPipelineHash hash{destFramebuffer->format, DepthFmt::Unknown1};
Expand Down Expand Up @@ -452,6 +454,7 @@ void RendererMTL::textureCopy(u32 inputAddr, u32 outputAddr, u32 totalBytes, u32
colorAttachment->setLoadAction(MTL::LoadActionClear);
colorAttachment->setClearColor(MTL::ClearColor{0.0, 0.0, 0.0, 1.0});
colorAttachment->setStoreAction(MTL::StoreActionStore);
colorAttachment->release();

// Pipeline
Metal::BlitPipelineHash hash{destFramebuffer->format, DepthFmt::Unknown1};
Expand Down

0 comments on commit 6b108e1

Please sign in to comment.