mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38: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);
|
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