From abb16f0e2161ebb6754406a650d93a4101f94565 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Wed, 29 Aug 2018 00:03:51 -0700 Subject: Added few debug checks --- Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Graphics/GraphicsEngineD3D12') 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; -- cgit v1.2.3