Flush some commands before object destruction

This commit is contained in:
baldurk committed 2022-02-08 18:07:38 +00:00
1 parent 597644435d
commit b78f4b5624
3 files changed
+11 -3

No files matched your search

+3 -3
View File
@@ -347,12 +347,12 @@ void WrappedVulkan::SubmitCmds(VkSemaphore *unwrappedWaitSemaphores,
CheckVkResult(vkr);
}
m_InternalCmds.submittedcmds.append(m_InternalCmds.pendingcmds);
m_InternalCmds.pendingcmds.clear();
#if ENABLED(SINGLE_FLUSH_VALIDATE)
FlushQ();
#endif
m_InternalCmds.submittedcmds.append(m_InternalCmds.pendingcmds);
m_InternalCmds.pendingcmds.clear();
}
VkSemaphore WrappedVulkan::GetNextSemaphore()
@@ -85,6 +85,9 @@ VulkanReplay::OutputWindow::OutputWindow()
void VulkanReplay::OutputWindow::Destroy(WrappedVulkan *driver, VkDevice device)
{
driver->SubmitCmds();
driver->FlushQ();
const VkDevDispatchTable *vt = ObjDisp(device);
vt->DeviceWaitIdle(Unwrap(device));
@@ -39,6 +39,11 @@ void VulkanReplay::CreateTexImageView(VkImage liveIm, const VulkanCreationInfo::
if(views.typeCast != typeCast)
{
// if the type hint has changed, recreate the image views
// flush any pending commands that might use the old views
m_pDriver->SubmitCmds();
m_pDriver->FlushQ();
for(size_t i = 0; i < ARRAY_COUNT(views.views); i++)
{
m_pDriver->vkDestroyImageView(dev, views.views[i], NULL);