From 3594d22c4a575c0551a3aa101c91de8f3c573e07 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 6 Oct 2018 16:12:51 -0700 Subject: Re-enabled idling GPU in VulkanDynamicMemoryManager::AllocateMasterBlock() since that seems to not cause a deadlock anymore --- Graphics/GraphicsEngineVulkan/src/VulkanDynamicHeap.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/src/VulkanDynamicHeap.cpp b/Graphics/GraphicsEngineVulkan/src/VulkanDynamicHeap.cpp index 0e5f4957..d14d3fb4 100644 --- a/Graphics/GraphicsEngineVulkan/src/VulkanDynamicHeap.cpp +++ b/Graphics/GraphicsEngineVulkan/src/VulkanDynamicHeap.cpp @@ -160,19 +160,17 @@ VulkanDynamicMemoryManager::MasterBlock VulkanDynamicMemoryManager::AllocateMast if (!Block.IsValid()) { - // Last resort - idle GPU (there seems to be a driver bug: vkQueueWaitIdle() deadlocks and never returns) - //m_DeviceVk.IdleGPU(true); - //auto LastCompletedFenceValue = m_DeviceVk.GetCompletedFenceValue(); - //m_AllocationStrategy.ReleaseStaleAllocations(LastCompletedFenceValue); - //Offset = m_AllocationStrategy.Allocate(SizeInBytes); + // Last resort - idle GPU (there seems to have been a driver bug at some point: vkQueueWaitIdle() would deadlock and never return) + m_DeviceVk.IdleGPU(); + Block = TBase::AllocateMasterBlock(SizeInBytes, Alignment); if (!Block.IsValid()) { LOG_ERROR_MESSAGE("Space in dynamic heap is exausted! After idling for ", std::fixed, std::setprecision(1), IdleDuration.count()*1000.0, " ms still no space is available. Increase the size of the heap by setting EngineVkAttribs::DynamicHeapSize to a greater value or optimize dynamic resource usage"); } - //else - //{ - // LOG_WARNING_MESSAGE("Space in dynamic heap is almost exausted. Allocation forced idling the GPU. Increase the size of the heap by setting EngineVkAttribs::DynamicHeapSize to a greater value or optimize dynamic resource usage"); - //} + else + { + LOG_WARNING_MESSAGE("Space in dynamic heap is almost exausted. Allocation forced idling the GPU. Increase the size of the heap by setting EngineVkAttribs::DynamicHeapSize to a greater value or optimize dynamic resource usage"); + } } else { -- cgit v1.2.3