summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2025-06-09 00:10:31 -0400
committerGitHub <noreply@github.com>2025-06-09 00:10:31 -0400
commit1526c0613386fc54c2541aec3a8d2ceefcbe23eb (patch)
tree7c1b724a508aee2fd5d889f7db23ababd70ca7b0 /Source/Core/VideoBackends
parent7ad85e875df1c38ae591f2be7eddb85ae51df964 (diff)
parent1554e4ab6c99510c9e2c1518ff8a0e7f62112e18 (diff)
Merge pull request #13658 from jordan-woyak/vk-present-done-race
Vulkan: Eliminate m_last_present_done flag.
Diffstat (limited to 'Source/Core/VideoBackends')
-rw-r--r--Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp1
-rw-r--r--Source/Core/VideoBackends/Vulkan/CommandBufferManager.h10
-rw-r--r--Source/Core/VideoBackends/Vulkan/VKGfx.cpp8
3 files changed, 1 insertions, 18 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp
index be262d98dd..291f28ce6e 100644
--- a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp
+++ b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp
@@ -440,7 +440,6 @@ void CommandBufferManager::SubmitCommandBuffer(u32 command_buffer_index,
nullptr};
m_last_present_result = vkQueuePresentKHR(g_vulkan_context->GetPresentQueue(), &present_info);
- m_last_present_done.Set();
if (m_last_present_result != VK_SUCCESS)
{
// VK_ERROR_OUT_OF_DATE_KHR is not fatal, just means we need to recreate our swap chain.
diff --git a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.h b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.h
index f0eff4e955..bcf310f5a6 100644
--- a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.h
+++ b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.h
@@ -4,20 +4,12 @@
#pragma once
#include <array>
-#include <cstddef>
-#include <deque>
#include <functional>
-#include <map>
#include <memory>
-#include <mutex>
-#include <thread>
-#include <utility>
#include <vector>
#include <Common/WorkQueueThread.h>
-#include "Common/BlockingLoop.h"
#include "Common/Flag.h"
-#include "Common/Semaphore.h"
#include "VideoBackends/Vulkan/Constants.h"
@@ -92,7 +84,6 @@ public:
// Was the last present submitted to the queue a failure? If so, we must recreate our swapchain.
bool CheckLastPresentFail() { return m_last_present_failed.TestAndClear(); }
VkResult GetLastPresentResult() const { return m_last_present_result; }
- bool CheckLastPresentDone() { return m_last_present_done.TestAndClear(); }
// Schedule a vulkan resource for destruction later on. This will occur when the command buffer
// is next re-used, and the GPU has finished working with the specified resource.
@@ -164,7 +155,6 @@ private:
Common::WorkQueueThreadSP<PendingCommandBufferSubmit> m_submit_thread;
VkSemaphore m_present_semaphore = VK_NULL_HANDLE;
Common::Flag m_last_present_failed;
- Common::Flag m_last_present_done;
VkResult m_last_present_result = VK_SUCCESS;
bool m_use_threaded_submission = false;
u32 m_descriptor_set_count = DESCRIPTOR_SETS_PER_POOL;
diff --git a/Source/Core/VideoBackends/Vulkan/VKGfx.cpp b/Source/Core/VideoBackends/Vulkan/VKGfx.cpp
index b30dd3894e..a3258a9274 100644
--- a/Source/Core/VideoBackends/Vulkan/VKGfx.cpp
+++ b/Source/Core/VideoBackends/Vulkan/VKGfx.cpp
@@ -3,14 +3,9 @@
#include "VideoBackends/Vulkan/VKGfx.h"
-#include <algorithm>
#include <cstddef>
#include <cstdio>
-#include <limits>
-#include <string>
-#include <tuple>
-#include "Common/Assert.h"
#include "Common/CommonTypes.h"
#include "Common/EnumUtils.h"
#include "Common/Logging/Log.h"
@@ -225,8 +220,7 @@ bool VKGfx::BindBackbuffer(const ClearColor& clear_color)
{
StateTracker::GetInstance()->EndRenderPass();
- if (!g_command_buffer_mgr->CheckLastPresentDone())
- g_command_buffer_mgr->WaitForWorkerThreadIdle();
+ g_command_buffer_mgr->WaitForWorkerThreadIdle();
// Handle host window resizes.
CheckForSurfaceChange();