summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VideoBackendBase.cpp
diff options
context:
space:
mode:
authorDentomologist <dentomologist@gmail.com>2024-09-24 12:55:43 -0700
committerDentomologist <dentomologist@gmail.com>2024-09-26 17:12:26 -0700
commit91f7b776ca51b06f33e72c92854a960c2fbaad8b (patch)
tree7e193e4ce0d8f39fb953a53c35a5e0a80702cf18 /Source/Core/VideoCommon/VideoBackendBase.cpp
parentde67c4c93bd15846f68df4006dd2c93fba5720d2 (diff)
GraphicsWindow: Fix crash when opening during emulation startup
Fix a crash when opening the Graphics window for the first time during emulation startup when the backend is Vulkan, D3D11, or D3D12. Don't call PopulateBackendInfo() from the Host thread when the core is starting up. First, the function has already been called in Core::Init() so we don't need to again. More importantly, PopulateBackendInfo() calls g_video_backend->InitBackendInfo(), and the Vulkan and D3D implementations of those functions load and then unload libraries (and their associated function pointers) which are potentially in use by other threads. This crash was reliably reproducible with the following steps: 1) Select an affected backend. 2) Enable "Compile Shaders Before Starting" 3) Delete the cached shaders (but not the .uidcache file) for the game you're testing. 4) Close and reopen Dolphin. 5) Start the game. 6) While the game is still booting or compiling shaders, open the Graphics window for the first time in that Dolphin session. Fixes https://bugs.dolphin-emu.org/issues/13634.
Diffstat (limited to 'Source/Core/VideoCommon/VideoBackendBase.cpp')
-rw-r--r--Source/Core/VideoCommon/VideoBackendBase.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/VideoBackendBase.cpp b/Source/Core/VideoCommon/VideoBackendBase.cpp
index 1db7fb2ab6..0bbc734e3b 100644
--- a/Source/Core/VideoCommon/VideoBackendBase.cpp
+++ b/Source/Core/VideoCommon/VideoBackendBase.cpp
@@ -300,7 +300,7 @@ void VideoBackendBase::PopulateBackendInfoFromUI(const WindowSystemInfo& wsi)
{
// If the core is running, the backend info will have been populated already.
// If we did it here, the UI thread can race with the with the GPU thread.
- if (!Core::IsRunning(Core::System::GetInstance()))
+ if (!Core::IsRunningOrStarting(Core::System::GetInstance()))
PopulateBackendInfo(wsi);
}