summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2019-12-23 18:44:13 +0000
committerassiduous <assiduous@diligentgraphics.com>2019-12-23 18:44:13 +0000
commit9393ce98a7c6f0a969510503f3b2cf64198273ba (patch)
tree97ae6d4fd88d317af36f34f9ae31fd9ffaceaa1e /Graphics/GraphicsEngineD3D11
parentFixed formatting (diff)
downloadDiligentCore-9393ce98a7c6f0a969510503f3b2cf64198273ba.tar.gz
DiligentCore-9393ce98a7c6f0a969510503f3b2cf64198273ba.zip
Renamed MAP_FLAG_DO_NOT_SYNCHRONIZE flag to MAP_FLAG_NO_OVERWRITE (API version )
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
-rw-r--r--Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.h2
-rwxr-xr-xGraphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp8
2 files changed, 7 insertions, 3 deletions
diff --git a/Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.h b/Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.h
index 388292bc..c2d35f8c 100644
--- a/Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.h
+++ b/Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.h
@@ -110,7 +110,7 @@ inline void MapParamsToD3D11MapParams(MAP_TYPE MapType, Uint32 MapFlags, D3D11_M
case MAP_WRITE:
if (MapFlags & MAP_FLAG_DISCARD)
d3d11MapType = D3D11_MAP_WRITE_DISCARD;
- else if (MapFlags & MAP_FLAG_DO_NOT_SYNCHRONIZE)
+ else if (MapFlags & MAP_FLAG_NO_OVERWRITE)
d3d11MapType = D3D11_MAP_WRITE_NO_OVERWRITE;
else
d3d11MapType = D3D11_MAP_WRITE;
diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
index ee99c2ba..947c9846 100755
--- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
@@ -1036,8 +1036,12 @@ void DeviceContextD3D11Impl::MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_F
MapParamsToD3D11MapParams(MapType, MapFlags, d3d11MapType, d3d11MapFlags);
D3D11_MAPPED_SUBRESOURCE MappedBuff;
- HRESULT hr = m_pd3d11DeviceContext->Map(pBufferD3D11->m_pd3d11Buffer, 0, d3d11MapType, d3d11MapFlags, &MappedBuff);
- DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to map buffer '", pBufferD3D11->GetDesc().Name, "'");
+
+ HRESULT hr = m_pd3d11DeviceContext->Map(pBufferD3D11->m_pd3d11Buffer, 0, d3d11MapType, d3d11MapFlags, &MappedBuff);
+ if ((d3d11MapFlags & D3D11_MAP_FLAG_DO_NOT_WAIT) == 0)
+ {
+ DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to map buffer '", pBufferD3D11->GetDesc().Name, "'");
+ }
pMappedData = SUCCEEDED(hr) ? MappedBuff.pData : nullptr;
}