vk: Fix dma resource leak

- Fix broken check; a relic of the past where flush method would reset the fence
This commit is contained in:
kd-11 2020-02-29 23:30:52 +03:00 committed by Ivan
parent 9af52d12a8
commit 76bbbe27f1

View file

@ -69,13 +69,7 @@ namespace vk
{ {
// Even if we are managing the same vram section, we cannot guarantee contents are static // Even if we are managing the same vram section, we cannot guarantee contents are static
// The create method is only invoked when a new managed session is required // The create method is only invoked when a new managed session is required
if (!flushed) release_dma_resources();
{
// Reset fence
verify(HERE), m_device, dma_fence;
vk::get_resource_manager()->dispose(dma_fence);
}
synchronized = false; synchronized = false;
flushed = false; flushed = false;
sync_timestamp = 0ull; sync_timestamp = 0ull;
@ -176,7 +170,9 @@ namespace vk
if (dma_fence) if (dma_fence)
{ {
verify(HERE), synchronized; // NOTE: This can be reached if previously synchronized, or a special path happens.
// If a hard flush occurred while this surface was flush_always the cache would have reset its protection afterwards.
// DMA resource would still be present but already used to flush previously.
vk::get_resource_manager()->dispose(dma_fence); vk::get_resource_manager()->dispose(dma_fence);
} }