From f66cee08e82f194d3b95ab0ea77a28f9aea3222c Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 18 Apr 2019 07:36:42 -0700 Subject: Fixed handling compressed textures in TextureUploaderGL; fixed non-compressed texture offset in Vk backend --- Graphics/GraphicsTools/src/TextureUploaderGL.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'Graphics/GraphicsTools') 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 pStagingBuffer; m_pDevice->CreateBuffer(BuffDesc, nullptr, &pBuffer->m_pStagingBuffer); } -- cgit v1.2.3