Don't mark any resource dirty while capturing a frame

This commit is contained in:
baldurk
2015-10-06 20:46:50 +02:00
parent 7107fd5825
commit 8bc874d973
4 changed files with 21 additions and 8 deletions
@@ -285,7 +285,10 @@ VkResult WrappedVulkan::vkAllocDescriptorSets(
record->AddParent(GetResourceManager()->GetResourceRecord(layoutID));
// just always treat descriptor sets as dirty
GetResourceManager()->MarkDirtyResource(id);
if(m_State != WRITING_CAPFRAME)
GetResourceManager()->MarkDirtyResource(id);
else
GetResourceManager()->MarkPendingDirty(id);
record->layout = layoutID;
m_CreationInfo.m_DescSetLayout[layoutID].CreateBindingsArray(record->descBindings);
@@ -387,8 +387,17 @@ VkResult WrappedVulkan::vkQueueSubmit(
GetResourceManager()->ApplyTransitions(m_CmdBufferInfo[cmd].imgtransitions, m_ImageInfo);
VkResourceRecord *record = GetRecord(pCmdBuffers[i]);
for(auto it = record->bakedCommands->dirtied.begin(); it != record->bakedCommands->dirtied.end(); ++it)
GetResourceManager()->MarkDirtyResource(*it);
if(m_State == WRITING_CAPFRAME)
{
for(auto it = record->bakedCommands->dirtied.begin(); it != record->bakedCommands->dirtied.end(); ++it)
GetResourceManager()->MarkPendingDirty(*it);
}
else
{
for(auto it = record->bakedCommands->dirtied.begin(); it != record->bakedCommands->dirtied.end(); ++it)
GetResourceManager()->MarkDirtyResource(*it);
}
if(m_State == WRITING_CAPFRAME)
{
@@ -94,7 +94,10 @@ VkResult WrappedVulkan::vkAllocMemory(
// VKTODOMED always treat memory as dirty for now, so its initial state
// is guaranteed to be prepared
GetResourceManager()->MarkDirtyResource(id);
if(m_State != WRITING_CAPFRAME)
GetResourceManager()->MarkDirtyResource(id);
else
GetResourceManager()->MarkPendingDirty(id);
}
else
{
@@ -157,10 +160,6 @@ VkResult WrappedVulkan::vkMapMemory(
it->second.refData = NULL;
}
}
else if(m_State >= WRITING)
{
GetResourceManager()->MarkDirtyResource(id);
}
}
return ret;
@@ -958,6 +958,8 @@ VkResult WrappedVulkan::vkQueuePresentWSI(
GetResourceManager()->MarkUnwrittenResources();
GetResourceManager()->ClearReferencedResources();
GetResourceManager()->FlushPendingDirty();
}
}