diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-08-29 06:12:19 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-08-29 06:12:19 +0000 |
| commit | 0c40c699a5dee845c6d2a5e734cdc4537e1dd3fa (patch) | |
| tree | 2adc2d782be58d887b12dc25a2864b4b2018ec54 /Graphics/GraphicsEngineVulkan | |
| parent | Implemented UpdateTexture in Vulkan (diff) | |
| download | DiligentCore-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.cpp | 5 |
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); } } |
