mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Add another row to do the copying for presented images in when pitch is bigger than width
This commit is contained in:
parent
3d30ce4bf2
commit
3595b70170
|
@ -1508,8 +1508,9 @@ protected:
|
||||||
vkInvalidateMappedMemoryRanges(m_VKDevice, 1, &MemRange);
|
vkInvalidateMappedMemoryRanges(m_VKDevice, 1, &MemRange);
|
||||||
|
|
||||||
size_t RealFullImageSize = maximum(ImageTotalSize, (size_t)(Height * m_GetPresentedImgDataHelperMappedLayoutPitch));
|
size_t RealFullImageSize = maximum(ImageTotalSize, (size_t)(Height * m_GetPresentedImgDataHelperMappedLayoutPitch));
|
||||||
if(vDstData.size() < RealFullImageSize)
|
size_t ExtraRowSize = Width * 4;
|
||||||
vDstData.resize(RealFullImageSize);
|
if(vDstData.size() < RealFullImageSize + ExtraRowSize)
|
||||||
|
vDstData.resize(RealFullImageSize + ExtraRowSize);
|
||||||
|
|
||||||
mem_copy(vDstData.data(), pResImageData, RealFullImageSize);
|
mem_copy(vDstData.data(), pResImageData, RealFullImageSize);
|
||||||
|
|
||||||
|
@ -1520,7 +1521,8 @@ protected:
|
||||||
{
|
{
|
||||||
size_t OffsetImagePacked = (Y * Width * 4);
|
size_t OffsetImagePacked = (Y * Width * 4);
|
||||||
size_t OffsetImageUnpacked = (Y * m_GetPresentedImgDataHelperMappedLayoutPitch);
|
size_t OffsetImageUnpacked = (Y * m_GetPresentedImgDataHelperMappedLayoutPitch);
|
||||||
mem_copy(vDstData.data() + OffsetImagePacked, vDstData.data() + OffsetImageUnpacked, Width * 4);
|
mem_copy(vDstData.data() + RealFullImageSize, vDstData.data() + OffsetImageUnpacked, Width * 4);
|
||||||
|
mem_copy(vDstData.data() + OffsetImagePacked, vDstData.data() + RealFullImageSize, Width * 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue