mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 05:58:19 +00:00
Merge pull request #8914 from Jupeyy/pr_cpy_into_fake_buffer
Add another row to do the copying for presented images in when pitch is bigger than width
This commit is contained in:
commit
a865354320
|
@ -1508,8 +1508,9 @@ protected:
|
|||
vkInvalidateMappedMemoryRanges(m_VKDevice, 1, &MemRange);
|
||||
|
||||
size_t RealFullImageSize = maximum(ImageTotalSize, (size_t)(Height * m_GetPresentedImgDataHelperMappedLayoutPitch));
|
||||
if(vDstData.size() < RealFullImageSize)
|
||||
vDstData.resize(RealFullImageSize);
|
||||
size_t ExtraRowSize = Width * 4;
|
||||
if(vDstData.size() < RealFullImageSize + ExtraRowSize)
|
||||
vDstData.resize(RealFullImageSize + ExtraRowSize);
|
||||
|
||||
mem_copy(vDstData.data(), pResImageData, RealFullImageSize);
|
||||
|
||||
|
@ -1520,7 +1521,8 @@ protected:
|
|||
{
|
||||
size_t OffsetImagePacked = (Y * Width * 4);
|
||||
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