Skip to content

Commit 6a4ae21

Browse files
committed
VulkanDevice: Destroy context on zero refs with SDL window type
If it's not destroyed, it prevents OpenGL contexts from being created without any errors...
1 parent 3b17273 commit 6a4ae21

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/util/vulkan_loader.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,12 @@ void VulkanLoader::LockedReleaseVulkanInstance()
600600
// We specifically keep the instance around even after releasing it.
601601
// Both AMD on Windows and Mesa leak a few tens of megabytes for every instance...
602602
DEV_LOG("Released Vulkan instance, reference count {}", s_locals.reference_count);
603+
604+
#ifdef ENABLE_SDL
605+
// SDL Vulkan kinda breaks OpenGL contexts if the instance isn't destroyed...
606+
if (s_locals.window_type == WindowInfoType::SDL && s_locals.reference_count == 0)
607+
LockedDestroyVulkanInstance();
608+
#endif
603609
}
604610

605611
void VulkanLoader::LockedDestroyVulkanInstance()

0 commit comments

Comments
 (0)