From 76bfae0b232a1c524b538960dc5b673fcec0b49f Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 16 Jun 2018 19:21:46 -0700 Subject: Implemented forced wait when allocation from dynamic heap fails in Vulkan --- Graphics/GraphicsEngine/interface/MapHelper.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/interface/MapHelper.h b/Graphics/GraphicsEngine/interface/MapHelper.h index 4032952f..5134a0d1 100644 --- a/Graphics/GraphicsEngine/interface/MapHelper.h +++ b/Graphics/GraphicsEngine/interface/MapHelper.h @@ -114,12 +114,14 @@ public: auto &BuffDesc = pBuffer->GetDesc(); VERIFY(sizeof(DataType) <= BuffDesc.uiSizeInBytes, "Data type size exceeds buffer size"); #endif - m_pContext = pContext; - m_pBuffer = pBuffer; - m_MapType = MapType; - m_MapFlags = MapFlags; - m_pBuffer->Map(m_pContext, MapType, MapFlags, (PVoid&)m_pMappedData); - VERIFY( m_pMappedData, "Map failed" ); + pBuffer->Map(pContext, MapType, MapFlags, (PVoid&)m_pMappedData); + if(m_pMappedData != nullptr) + { + m_pContext = pContext; + m_pBuffer = pBuffer; + m_MapType = MapType; + m_MapFlags = MapFlags; + } } /// Unamps the resource and resets the object state to default. -- cgit v1.2.3