Fix TextureMipData::GetPixels to properly copy pixels of the same format

Fixes #988
This commit is contained in:
Wojtek Figat
2023-04-13 11:20:56 +02:00
parent f8bfc3520b
commit 8a44ea5a99

View File

@@ -86,7 +86,7 @@ bool TextureMipData::GetPixels(Array<Color32>& pixels, int32 width, int32 height
case PixelFormat::B8G8R8X8_UNorm:
case PixelFormat::B8G8R8X8_UNorm_sRGB:
if (srcRowSize == dstRowSize)
Platform::MemoryCopy(dst, src, size);
Platform::MemoryCopy(dst, src, RowPitch * Lines);
else
{
for (uint32 row = 0; row < Lines; row++)
@@ -135,7 +135,7 @@ bool TextureMipData::GetPixels(Array<Color>& pixels, int32 width, int32 height,
case PixelFormat::R32G32B32A32_Typeless:
case PixelFormat::R32G32B32A32_Float:
if (srcRowSize == dstRowSize)
Platform::MemoryCopy(dst, src, size);
Platform::MemoryCopy(dst, src, RowPitch * Lines);
else
{
for (uint32 row = 0; row < Lines; row++)