1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[dxvk] Get rid of spinlock when allocating GPU events

This is not performance-critical
This commit is contained in:
Philip Rebohle 2022-02-20 01:16:04 +01:00
parent 0ade12dc83
commit 80f744549f
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ namespace dxvk {
DxvkGpuEventHandle DxvkGpuEventPool::allocEvent() {
VkEvent event = VK_NULL_HANDLE;
{ std::lock_guard<sync::Spinlock> lock(m_mutex);
{ std::lock_guard<dxvk::mutex> lock(m_mutex);
if (m_events.size() > 0) {
event = m_events.back();
@ -77,7 +77,7 @@ namespace dxvk {
void DxvkGpuEventPool::freeEvent(VkEvent event) {
std::lock_guard<sync::Spinlock> lock(m_mutex);
std::lock_guard<dxvk::mutex> lock(m_mutex);
m_events.push_back(event);
}

View File

@ -111,7 +111,7 @@ namespace dxvk {
private:
Rc<vk::DeviceFn> m_vkd;
sync::Spinlock m_mutex;
dxvk::mutex m_mutex;
std::vector<VkEvent> m_events;
};