summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-08-29 06:12:19 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-08-29 06:12:19 +0000
commit0c40c699a5dee845c6d2a5e734cdc4537e1dd3fa (patch)
tree2adc2d782be58d887b12dc25a2864b4b2018ec54 /Graphics/GraphicsEngineVulkan
parentImplemented UpdateTexture in Vulkan (diff)
downloadDiligentCore-0c40c699a5dee845c6d2a5e734cdc4537e1dd3fa.tar.gz
DiligentCore-0c40c699a5dee845c6d2a5e734cdc4537e1dd3fa.zip
Fixed issue in update texture methods in Vk and D3D12; updated copy from buffer to texture in D3D12
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);
}
}