summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsTools
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-04-18 14:36:42 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-04-18 14:36:42 +0000
commitf66cee08e82f194d3b95ab0ea77a28f9aea3222c (patch)
treed94fe054264df48b5d7aac3bbbb229f56b83dee7 /Graphics/GraphicsTools
parentFixed copying compressed textures in Vulkan back-end (diff)
downloadDiligentCore-f66cee08e82f194d3b95ab0ea77a28f9aea3222c.tar.gz
DiligentCore-f66cee08e82f194d3b95ab0ea77a28f9aea3222c.zip
Fixed handling compressed textures in TextureUploaderGL; fixed non-compressed texture offset in Vk backend
Diffstat (limited to 'Graphics/GraphicsTools')
-rw-r--r--Graphics/GraphicsTools/src/TextureUploaderGL.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/Graphics/GraphicsTools/src/TextureUploaderGL.cpp b/Graphics/GraphicsTools/src/TextureUploaderGL.cpp
index 2ba1301c..be85e196 100644
--- a/Graphics/GraphicsTools/src/TextureUploaderGL.cpp
+++ b/Graphics/GraphicsTools/src/TextureUploaderGL.cpp
@@ -195,12 +195,8 @@ void TextureUploaderGL::RenderThreadUpdate(IDeviceContext *pContext)
BuffDesc.Usage = USAGE_STAGING;
const auto &TexFmtInfo = m_pDevice->GetTextureFormatInfo(Desc.Format);
- RowStride = Desc.Width * Uint32{TexFmtInfo.ComponentSize} * Uint32{TexFmtInfo.NumComponents};
- const Uint32 Alignment = 16;
- const Uint32 AlignmentMask = Alignment-1;
- RowStride = (RowStride + AlignmentMask) & (~AlignmentMask);
-
- BuffDesc.uiSizeInBytes = Desc.Height * RowStride;
+ RowStride = Desc.Width / Uint32{TexFmtInfo.BlockWidth} * TexFmtInfo.GetElementSize();
+ BuffDesc.uiSizeInBytes = Desc.Height / Uint32{TexFmtInfo.BlockHeight} * RowStride;
RefCntAutoPtr<IBuffer> pStagingBuffer;
m_pDevice->CreateBuffer(BuffDesc, nullptr, &pBuffer->m_pStagingBuffer);
}