summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
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/GraphicsEngineD3D12
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/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
index 7812afe0..3d4747fb 100644
--- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
@@ -1104,7 +1104,7 @@ void DeviceContextD3D12Impl::MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_F
}
else if (BuffDesc.Usage == USAGE_DYNAMIC)
{
- VERIFY((MapFlags & (MAP_FLAG_DISCARD | MAP_FLAG_DO_NOT_SYNCHRONIZE)) != 0, "D3D12 buffer must be mapped for writing with MAP_FLAG_DISCARD or MAP_FLAG_DO_NOT_SYNCHRONIZE flag");
+ VERIFY((MapFlags & (MAP_FLAG_DISCARD | MAP_FLAG_NO_OVERWRITE)) != 0, "D3D12 buffer must be mapped for writing with MAP_FLAG_DISCARD or MAP_FLAG_NO_OVERWRITE flag");
auto& DynamicData = pBufferD3D12->m_DynamicData[m_ContextId];
if ((MapFlags & MAP_FLAG_DISCARD) != 0 || DynamicData.CPUAddress == nullptr)
{
@@ -1113,7 +1113,7 @@ void DeviceContextD3D12Impl::MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_F
}
else
{
- VERIFY_EXPR(MapFlags & MAP_FLAG_DO_NOT_SYNCHRONIZE);
+ VERIFY_EXPR(MapFlags & MAP_FLAG_NO_OVERWRITE);
// Reuse previously mapped region
}
pMappedData = DynamicData.CPUAddress;
@@ -1530,8 +1530,8 @@ void DeviceContextD3D12Impl::MapTextureSubresource(ITexture* pTe
return;
}
- if ((MapFlags & (MAP_FLAG_DISCARD | MAP_FLAG_DO_NOT_SYNCHRONIZE)) != 0)
- LOG_INFO_MESSAGE_ONCE("Mapping textures with flags MAP_FLAG_DISCARD or MAP_FLAG_DO_NOT_SYNCHRONIZE has no effect in D3D12 backend");
+ if ((MapFlags & (MAP_FLAG_DISCARD | MAP_FLAG_NO_OVERWRITE)) != 0)
+ LOG_INFO_MESSAGE_ONCE("Mapping textures with flags MAP_FLAG_DISCARD or MAP_FLAG_NO_OVERWRITE has no effect in D3D12 backend");
Box FullExtentBox;
if (pMapRegion == nullptr)
@@ -1554,13 +1554,6 @@ void DeviceContextD3D12Impl::MapTextureSubresource(ITexture* pTe
}
else if (TexDesc.Usage == USAGE_STAGING)
{
- if ((MapFlags & MAP_FLAG_DO_NOT_SYNCHRONIZE) == 0)
- {
- LOG_WARNING_MESSAGE_ONCE("Mapping staging textures is never synchronized in D3D12 backend. "
- "Application must use fences or other synchronization methods to explicitly synchronize "
- "access and map texture with MAP_FLAG_DO_NOT_SYNCHRONIZE flag.");
- }
-
const auto& Footprint = TextureD3D12.GetStagingFootprint(Subres);
// It is valid to specify the CPU won't read any data by passing a range where
@@ -1569,6 +1562,13 @@ void DeviceContextD3D12Impl::MapTextureSubresource(ITexture* pTe
D3D12_RANGE InvalidateRange = {1, 0};
if (MapType == MAP_READ)
{
+ if ((MapFlags & MAP_FLAG_DO_NOT_WAIT) == 0)
+ {
+ LOG_WARNING_MESSAGE("Mapping staging textures for reading never blocks or waits for GPU in D3D12 backend. "
+ "Applications must use fences or other synchronization methods to explicitly synchronize "
+ "access and map texture with MAP_FLAG_DO_NOT_WAIT flag.");
+ }
+
DEV_CHECK_ERR((TexDesc.CPUAccessFlags & CPU_ACCESS_READ), "Texture '", TexDesc.Name, "' was not created with CPU_ACCESS_READ flag and can't be mapped for reading");
// Resources on D3D12_HEAP_TYPE_READBACK heaps do not support persistent map.
InvalidateRange.Begin = static_cast<SIZE_T>(Footprint.Offset);