diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-04-05 15:00:59 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-04-05 15:00:59 +0000 |
| commit | ceb1bc219e2eb5a4151130c2b5fb2833854a8b45 (patch) | |
| tree | 0cc40adb02d6018d04e0844e8fd291b99ff60c8e /Graphics/GraphicsEngineD3D12 | |
| parent | Fixed rotation matrices (diff) | |
| download | DiligentCore-ceb1bc219e2eb5a4151130c2b5fb2833854a8b45.tar.gz DiligentCore-ceb1bc219e2eb5a4151130c2b5fb2833854a8b45.zip | |
Implemented staging textures in Vk backend
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
| -rw-r--r-- | Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp index 0fb907da..d34bc493 100644 --- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp @@ -1403,7 +1403,7 @@ namespace Diligent } if( (MapFlags & (MAP_FLAG_DISCARD | MAP_FLAG_DO_NOT_SYNCHRONIZE)) != 0 ) - LOG_WARNING_MESSAGE_ONCE("Mapping textures with flags MAP_FLAG_DISCARD or MAP_FLAG_DO_NOT_SYNCHRONIZE has no effect in D3D12 backend"); + LOG_INFO_MESSAGE_ONCE("Mapping textures with flags MAP_FLAG_DISCARD or MAP_FLAG_DO_NOT_SYNCHRONIZE has no effect in D3D12 backend"); Box FullExtentBox; if (pMapRegion == nullptr) @@ -1455,10 +1455,15 @@ namespace Diligent D3D12_RANGE InvalidateRange = {1,0}; if (MapType == MAP_READ) { + 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); InvalidateRange.End = static_cast<SIZE_T>(Footprint.Offset + TotalBytes); } + else if (MapType == MAP_WRITE) + { + DEV_CHECK_ERR((TexDesc.CPUAccessFlags & CPU_ACCESS_WRITE), "Texture '", TexDesc.Name, "' was not created with CPU_ACCESS_WRITE flag and can't be mapped for writing"); + } // Nested Map() calls are supported and are ref-counted. The first call to Map() allocates // a CPU virtual address range for the resource. The last call to Unmap deallocates the CPU |
