Add hack to avoid breaking VkMarkerRegion with multiple vulkan instances

* This can happen when converting to structured data. We let the first
  WrappedVulkan 'claim' the static pointer, and ignore others. It's not
  perfect but avoids the need to refactor and pass in handle everywhere.
This commit is contained in:
baldurk
2018-05-14 16:43:57 +01:00
parent 8a05e29e86
commit f698bac6bf
+5 -1
View File
@@ -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.