mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-14 18:58:29 +12:00
fix: ImGui issues
This commit is contained in:
parent
b105a383aa
commit
c905399f1f
4 changed files with 38 additions and 45 deletions
|
@ -16,8 +16,6 @@ MetalLayerHandle::~MetalLayerHandle()
|
|||
{
|
||||
if (m_layer)
|
||||
m_layer->release();
|
||||
if (m_renderPassDescriptor)
|
||||
m_renderPassDescriptor->release();
|
||||
}
|
||||
|
||||
void MetalLayerHandle::Resize(const Vector2i& size)
|
||||
|
@ -37,27 +35,9 @@ bool MetalLayerHandle::AcquireDrawable()
|
|||
return false;
|
||||
}
|
||||
|
||||
if (m_renderPassDescriptor)
|
||||
{
|
||||
m_renderPassDescriptor->release();
|
||||
m_renderPassDescriptor = nullptr;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void MetalLayerHandle::CreateRenderPassDescriptor(bool clear)
|
||||
{
|
||||
if (m_renderPassDescriptor)
|
||||
m_renderPassDescriptor->release();
|
||||
|
||||
m_renderPassDescriptor = MTL::RenderPassDescriptor::alloc()->init();
|
||||
auto colorAttachment = m_renderPassDescriptor->colorAttachments()->object(0);
|
||||
colorAttachment->setTexture(m_drawable->texture());
|
||||
colorAttachment->setLoadAction(clear ? MTL::LoadActionClear : MTL::LoadActionLoad);
|
||||
colorAttachment->setStoreAction(MTL::StoreActionStore);
|
||||
}
|
||||
|
||||
void MetalLayerHandle::PresentDrawable(MTL::CommandBuffer* commandBuffer)
|
||||
{
|
||||
commandBuffer->presentDrawable(m_drawable);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue