Only mark resources as dirty if they are still alive

* We can have dangling references to resources due to descriptor binding
  references, so ignore any IDs that are no longer valid.
This commit is contained in:
baldurk
2018-08-03 14:07:03 +01:00
parent cbbce5b033
commit 104072debe
@@ -589,7 +589,10 @@ VkResult WrappedVulkan::vkQueueSubmit(VkQueue queue, uint32_t submitCount,
{
for(auto it = record->bakedCommands->cmdInfo->dirtied.begin();
it != record->bakedCommands->cmdInfo->dirtied.end(); ++it)
GetResourceManager()->MarkPendingDirty(*it);
{
if(GetResourceManager()->HasCurrentResource(*it))
GetResourceManager()->MarkPendingDirty(*it);
}
capframe = true;
}
@@ -597,7 +600,10 @@ VkResult WrappedVulkan::vkQueueSubmit(VkQueue queue, uint32_t submitCount,
{
for(auto it = record->bakedCommands->cmdInfo->dirtied.begin();
it != record->bakedCommands->cmdInfo->dirtied.end(); ++it)
GetResourceManager()->MarkDirtyResource(*it);
{
if(GetResourceManager()->HasCurrentResource(*it))
GetResourceManager()->MarkDirtyResource(*it);
}
}
}