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/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp index d61b947f..b389141f 100644 --- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp @@ -1141,6 +1141,8 @@ namespace Diligent auto PixelSize = Uint32{FmtAttribs.ComponentSize} * Uint32{FmtAttribs.NumComponents}; auto BufferDataStride = UpdateRegionWidth * PixelSize; auto BufferDataDepthStride = UpdateRegionHeight * BufferDataStride; + 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, ")"); auto MemorySize = UpdateRegionDepth * BufferDataDepthStride; size_t Alignment = 4; auto UploadSpace = AllocateDynamicSpace(MemorySize + static_cast(Alignment)); -- cgit v1.2.3