Skip to content

Commit

Permalink
Add another row to do the copying for presented images in when pitch …
Browse files Browse the repository at this point in the history
…is bigger than width
  • Loading branch information
Jupeyy committed Sep 7, 2024
1 parent 3d30ce4 commit 3595b70
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/engine/client/backend/vulkan/backend_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1508,8 +1508,9 @@ class CCommandProcessorFragment_Vulkan : public CCommandProcessorFragment_GLBase
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);

Expand All @@ -1520,7 +1521,8 @@ class CCommandProcessorFragment_Vulkan : public CCommandProcessorFragment_GLBase
{
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);
}
}

Expand Down

0 comments on commit 3595b70

Please sign in to comment.