diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index 8f1420440..7432866aa 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -91,7 +91,8 @@ WrappedVulkan::WrappedVulkan() : m_RenderState(this, &m_CreationInfo) { if(RenderDoc::Inst().IsReplayApp()) { - VkMarkerRegion::vk = this; + if(VkMarkerRegion::vk == NULL) + VkMarkerRegion::vk = this; m_State = CaptureState::LoadingReplaying; } @@ -170,6 +171,9 @@ WrappedVulkan::~WrappedVulkan() m_FrameCaptureRecord = NULL; } + if(VkMarkerRegion::vk == this) + VkMarkerRegion::vk = NULL; + // in case the application leaked some objects, avoid crashing trying // to release them ourselves by clearing the resource manager. // In a well-behaved application, this should be a no-op.