summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/VKMain.cpp
diff options
context:
space:
mode:
authorTilka <tilkax@gmail.com>2025-07-22 03:03:04 +0100
committerGitHub <noreply@github.com>2025-07-22 03:03:04 +0100
commit79a3af2e6e8f905de081489e5d40ef8dd4fc1db5 (patch)
tree6b98ca059ff73296771fd25beed70e92e70e571b /Source/Core/VideoBackends/Vulkan/VKMain.cpp
parentc6de692d01bd71ee501e4a7dfb3361c620b482f1 (diff)
parentb80e178403d895409b481132fb8d62b46bfd8391 (diff)
Merge pull request #13805 from SuperSamus/vulkan-present-sempahore-reuse-fix
Vulkan: Fix present semaphores reuse
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/VKMain.cpp')
-rw-r--r--Source/Core/VideoBackends/Vulkan/VKMain.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/VKMain.cpp b/Source/Core/VideoBackends/Vulkan/VKMain.cpp
index e5ecd5a4de..6338e52e3d 100644
--- a/Source/Core/VideoBackends/Vulkan/VKMain.cpp
+++ b/Source/Core/VideoBackends/Vulkan/VKMain.cpp
@@ -187,15 +187,6 @@ bool VideoBackend::Initialize(const WindowSystemInfo& wsi)
UpdateActiveConfig();
- // Create command buffers. We do this separately because the other classes depend on it.
- g_command_buffer_mgr = std::make_unique<CommandBufferManager>(g_Config.bBackendMultithreading);
- if (!g_command_buffer_mgr->Initialize())
- {
- PanicAlertFmt("Failed to create Vulkan command buffers");
- Shutdown();
- return false;
- }
-
// Remaining classes are also dependent on object cache.
g_object_cache = std::make_unique<ObjectCache>();
if (!g_object_cache->Initialize())
@@ -218,6 +209,17 @@ bool VideoBackend::Initialize(const WindowSystemInfo& wsi)
}
}
+ // Create command buffers. We do this separately because the other classes depend on it.
+ g_command_buffer_mgr = std::make_unique<CommandBufferManager>(g_Config.bBackendMultithreading);
+ size_t swapchain_image_count =
+ surface != VK_NULL_HANDLE ? swap_chain->GetSwapChainImageCount() : 0;
+ if (!g_command_buffer_mgr->Initialize(swapchain_image_count))
+ {
+ PanicAlertFmt("Failed to create Vulkan command buffers");
+ Shutdown();
+ return false;
+ }
+
if (!StateTracker::CreateInstance())
{
PanicAlertFmt("Failed to create state tracker");