summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-08-29 07:03:51 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-08-29 07:03:51 +0000
commitabb16f0e2161ebb6754406a650d93a4101f94565 (patch)
tree8bdd34d513d6b5e89a948312fbf593742a8b20dc /Graphics/GraphicsEngineD3D12
parentFixed issue in update texture methods in Vk and D3D12; updated copy from buff... (diff)
downloadDiligentCore-abb16f0e2161ebb6754406a650d93a4101f94565.tar.gz
DiligentCore-abb16f0e2161ebb6754406a650d93a4101f94565.zip
Added few debug checks
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
index 8d98edc5..94a25e8f 100644
--- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
@@ -852,6 +852,8 @@ namespace Diligent
auto UpdateRegionDepth = DstBox.MaxZ - DstBox.MinZ;
auto PixelSize = Uint32{FmtAttribs.ComponentSize} * Uint32{FmtAttribs.NumComponents};
auto BufferDataStride = UpdateRegionWidth * PixelSize;
+ VERIFY(SrcStride >= UpdateRegionWidth * PixelSize, "Source data stride (", SrcStride, ") is below the image row width (", UpdateRegionWidth * PixelSize, ")");
+ VERIFY(SrcDepthStride == 0 || SrcDepthStride >= SrcStride * UpdateRegionHeight, "Source data depth stride (", SrcDepthStride, ") is below the image plane size (", SrcStride * UpdateRegionHeight, ")");
// RowPitch must be a multiple of 256 (aka. D3D12_TEXTURE_DATA_PITCH_ALIGNMENT)
BufferDataStride = (BufferDataStride + D3D12_TEXTURE_DATA_PITCH_ALIGNMENT-1) & ~(D3D12_TEXTURE_DATA_PITCH_ALIGNMENT-1);
auto BufferDataDepthStride = UpdateRegionHeight * BufferDataStride;