mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-14 18:58:29 +12:00
add: ImGui support
This commit is contained in:
parent
d4a1074425
commit
7499c3fbe7
7 changed files with 805 additions and 43 deletions
|
@ -16,6 +16,8 @@ MetalLayerHandle::~MetalLayerHandle()
|
|||
{
|
||||
if (m_layer)
|
||||
m_layer->release();
|
||||
if (m_renderPassDescriptor)
|
||||
m_renderPassDescriptor->release();
|
||||
}
|
||||
|
||||
void MetalLayerHandle::Resize(const Vector2i& size)
|
||||
|
@ -35,9 +37,27 @@ 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