mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-21 06:51:35 +00:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user