diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-07-22 18:47:37 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-07-22 18:47:37 +0000 |
| commit | 5eca9ecce9770af037006c31f206bdad22b10be2 (patch) | |
| tree | bd8f40bbf333f64c5390b1b0d8cbfd063741e8dc /Graphics/GraphicsEngine | |
| parent | Fixed release build error (diff) | |
| download | DiligentCore-5eca9ecce9770af037006c31f206bdad22b10be2.tar.gz DiligentCore-5eca9ecce9770af037006c31f206bdad22b10be2.zip | |
Implemented mapping with MAP_FLAG_DO_NOT_SYNCHRONIZE flag in Vulkan and D3D12
Diffstat (limited to 'Graphics/GraphicsEngine')
| -rw-r--r-- | Graphics/GraphicsEngine/include/BufferBase.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Graphics/GraphicsEngine/include/BufferBase.h b/Graphics/GraphicsEngine/include/BufferBase.h index 66096e3c..d3eaf2d4 100644 --- a/Graphics/GraphicsEngine/include/BufferBase.h +++ b/Graphics/GraphicsEngine/include/BufferBase.h @@ -173,8 +173,9 @@ void BufferBase<BaseInterface, BufferViewImplType, TBuffViewObjAllocator> :: Cop template<class BaseInterface, class BufferViewImplType, class TBuffViewObjAllocator> -void BufferBase<BaseInterface, BufferViewImplType, TBuffViewObjAllocator> :: Map( IDeviceContext* pContext, MAP_TYPE MapType, Uint32 MapFlags, PVoid &pMappedData ) +void BufferBase<BaseInterface, BufferViewImplType, TBuffViewObjAllocator> :: Map( IDeviceContext* pContext, MAP_TYPE MapType, Uint32 MapFlags, PVoid& pMappedData ) { + pMappedData = nullptr; switch( MapType ) { case MAP_READ: @@ -200,7 +201,8 @@ void BufferBase<BaseInterface, BufferViewImplType, TBuffViewObjAllocator> :: Map if (this->m_Desc.Usage == USAGE_DYNAMIC) { - VERIFY_BUFFER((MapFlags & MAP_FLAG_DISCARD) != 0 && MapType == MAP_WRITE, "Dynamic buffers can only be mapped for writing with discard flag"); + VERIFY_BUFFER((MapFlags & (MAP_FLAG_DISCARD | MAP_FLAG_DO_NOT_SYNCHRONIZE)) != 0 && MapType == MAP_WRITE, "Dynamic buffers can only be mapped for writing with MAP_FLAG_DISCARD or MAP_FLAG_DO_NOT_SYNCHRONIZE flag"); + VERIFY_BUFFER((MapFlags & (MAP_FLAG_DISCARD | MAP_FLAG_DO_NOT_SYNCHRONIZE)) != (MAP_FLAG_DISCARD | MAP_FLAG_DO_NOT_SYNCHRONIZE), "When mapping dynamic buffer, only one of MAP_FLAG_DISCARD or MAP_FLAG_DO_NOT_SYNCHRONIZE flags must be specified"); } if ( (MapFlags & MAP_FLAG_DISCARD) != 0 ) |
