summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
index 13f93285..d61b947f 100644
--- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
@@ -1138,7 +1138,8 @@ namespace Diligent
auto UpdateRegionWidth = DstBox.MaxX - DstBox.MinX;
auto UpdateRegionHeight = DstBox.MaxY - DstBox.MinY;
auto UpdateRegionDepth = DstBox.MaxZ - DstBox.MinZ;
- auto BufferDataStride = UpdateRegionWidth * Uint32{FmtAttribs.ComponentSize} * Uint32{FmtAttribs.NumComponents};
+ auto PixelSize = Uint32{FmtAttribs.ComponentSize} * Uint32{FmtAttribs.NumComponents};
+ auto BufferDataStride = UpdateRegionWidth * PixelSize;
auto BufferDataDepthStride = UpdateRegionHeight * BufferDataStride;
auto MemorySize = UpdateRegionDepth * BufferDataDepthStride;
size_t Alignment = 4;
@@ -1158,7 +1159,7 @@ namespace Diligent
+ row * BufferDataStride
+ slice * BufferDataDepthStride;
- memcpy(pDstPtr, pSrcPtr, BufferDataStride);
+ memcpy(pDstPtr, pSrcPtr, UpdateRegionWidth * PixelSize);
}
}