summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-06-17 02:21:46 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-06-17 02:21:46 +0000
commit76bfae0b232a1c524b538960dc5b673fcec0b49f (patch)
treea88350a430257467d1391cf7e8b5087e360d5829 /Graphics/GraphicsEngine
parentImproved dynamic heap memory usage stats reporting (diff)
downloadDiligentCore-76bfae0b232a1c524b538960dc5b673fcec0b49f.tar.gz
DiligentCore-76bfae0b232a1c524b538960dc5b673fcec0b49f.zip
Implemented forced wait when allocation from dynamic heap fails in Vulkan
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/interface/MapHelper.h14
1 files changed, 8 insertions, 6 deletions
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.