mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-05 14:31:17 +12:00
Make controller button code thread-safe (#405)
* Refactor spinlock to meet Lockable requirements * Input: Refactor button code and make it thread-safe
This commit is contained in:
parent
c40466f3a8
commit
028b3f7992
28 changed files with 311 additions and 220 deletions
|
@ -3447,14 +3447,14 @@ void VulkanRenderer::releaseDestructibleObject(VKRDestructibleObject* destructib
|
|||
return;
|
||||
}
|
||||
// otherwise put on queue
|
||||
m_spinlockDestructionQueue.acquire();
|
||||
m_spinlockDestructionQueue.lock();
|
||||
m_destructionQueue.emplace_back(destructibleObject);
|
||||
m_spinlockDestructionQueue.release();
|
||||
m_spinlockDestructionQueue.unlock();
|
||||
}
|
||||
|
||||
void VulkanRenderer::ProcessDestructionQueue2()
|
||||
{
|
||||
m_spinlockDestructionQueue.acquire();
|
||||
m_spinlockDestructionQueue.lock();
|
||||
for (auto it = m_destructionQueue.begin(); it != m_destructionQueue.end();)
|
||||
{
|
||||
if ((*it)->canDestroy())
|
||||
|
@ -3465,7 +3465,7 @@ void VulkanRenderer::ProcessDestructionQueue2()
|
|||
}
|
||||
++it;
|
||||
}
|
||||
m_spinlockDestructionQueue.release();
|
||||
m_spinlockDestructionQueue.unlock();
|
||||
}
|
||||
|
||||
VkDescriptorSetInfo::~VkDescriptorSetInfo()
|
||||
|
@ -4010,9 +4010,9 @@ void VulkanRenderer::AppendOverlayDebugInfo()
|
|||
ImGui::Text("ImageView %u", performanceMonitor.vk.numImageViews.get());
|
||||
ImGui::Text("RenderPass %u", performanceMonitor.vk.numRenderPass.get());
|
||||
ImGui::Text("Framebuffer %u", performanceMonitor.vk.numFramebuffer.get());
|
||||
m_spinlockDestructionQueue.acquire();
|
||||
m_spinlockDestructionQueue.lock();
|
||||
ImGui::Text("DestructionQ %u", (unsigned int)m_destructionQueue.size());
|
||||
m_spinlockDestructionQueue.release();
|
||||
m_spinlockDestructionQueue.unlock();
|
||||
|
||||
|
||||
ImGui::Text("BeginRP/f %u", performanceMonitor.vk.numBeginRenderpassPerFrame.get());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue