mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-25 15:15:40 +00:00
MetalDevice: Fix render command encoder leak
and subsequent crash on shutdown.
This commit is contained in:
parent
08acc3144c
commit
1b9e72e3a6
|
@ -1829,21 +1829,23 @@ void MetalDevice::BeginRenderPass()
|
|||
m_inline_upload_encoder = nil;
|
||||
}
|
||||
|
||||
MTLRenderPassDescriptor* desc;
|
||||
if (!m_current_framebuffer)
|
||||
{
|
||||
// Rendering to view, but we got interrupted...
|
||||
desc = [MTLRenderPassDescriptor renderPassDescriptor];
|
||||
desc.colorAttachments[0].texture = [m_layer_drawable texture];
|
||||
desc.colorAttachments[0].loadAction = MTLLoadActionLoad;
|
||||
}
|
||||
else
|
||||
{
|
||||
desc = m_current_framebuffer->GetDescriptor();
|
||||
}
|
||||
@autoreleasepool {
|
||||
MTLRenderPassDescriptor* desc;
|
||||
if (!m_current_framebuffer)
|
||||
{
|
||||
// Rendering to view, but we got interrupted...
|
||||
desc = [MTLRenderPassDescriptor renderPassDescriptor];
|
||||
desc.colorAttachments[0].texture = [m_layer_drawable texture];
|
||||
desc.colorAttachments[0].loadAction = MTLLoadActionLoad;
|
||||
}
|
||||
else
|
||||
{
|
||||
desc = m_current_framebuffer->GetDescriptor();
|
||||
}
|
||||
|
||||
m_render_encoder = [m_render_cmdbuf renderCommandEncoderWithDescriptor:desc];
|
||||
SetInitialEncoderState();
|
||||
m_render_encoder = [[m_render_cmdbuf renderCommandEncoderWithDescriptor:desc] retain];
|
||||
SetInitialEncoderState();
|
||||
}
|
||||
}
|
||||
|
||||
void MetalDevice::EndRenderPass()
|
||||
|
|
Loading…
Reference in a new issue