mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +00:00
Remove unused FlipImgData
parameter from Vulkan backend
The parameter is always set to `false` so the code is unused.
This commit is contained in:
parent
b77e91633f
commit
0a0e066535
|
@ -1378,7 +1378,7 @@ protected:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] bool GetPresentedImageDataImpl(uint32_t &Width, uint32_t &Height, CImageInfo::EImageFormat &Format, std::vector<uint8_t> &vDstData, bool FlipImgData, bool ResetAlpha)
|
[[nodiscard]] bool GetPresentedImageDataImpl(uint32_t &Width, uint32_t &Height, CImageInfo::EImageFormat &Format, std::vector<uint8_t> &vDstData, bool ResetAlpha)
|
||||||
{
|
{
|
||||||
bool IsB8G8R8A8 = m_VKSurfFormat.format == VK_FORMAT_B8G8R8A8_UNORM;
|
bool IsB8G8R8A8 = m_VKSurfFormat.format == VK_FORMAT_B8G8R8A8_UNORM;
|
||||||
bool UsesRGBALikeFormat = m_VKSurfFormat.format == VK_FORMAT_R8G8B8A8_UNORM || IsB8G8R8A8;
|
bool UsesRGBALikeFormat = m_VKSurfFormat.format == VK_FORMAT_R8G8B8A8_UNORM || IsB8G8R8A8;
|
||||||
|
@ -1474,8 +1474,8 @@ 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 + (Width * 4))
|
if(vDstData.size() < RealFullImageSize)
|
||||||
vDstData.resize(RealFullImageSize + (Width * 4)); // extra space for flipping
|
vDstData.resize(RealFullImageSize);
|
||||||
|
|
||||||
mem_copy(vDstData.data(), pResImageData, RealFullImageSize);
|
mem_copy(vDstData.data(), pResImageData, RealFullImageSize);
|
||||||
|
|
||||||
|
@ -1507,17 +1507,6 @@ protected:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(FlipImgData)
|
|
||||||
{
|
|
||||||
uint8_t *pTempRow = vDstData.data() + Width * Height * 4;
|
|
||||||
for(uint32_t Y = 0; Y < Height / 2; ++Y)
|
|
||||||
{
|
|
||||||
mem_copy(pTempRow, vDstData.data() + Y * Width * 4, Width * 4);
|
|
||||||
mem_copy(vDstData.data() + Y * Width * 4, vDstData.data() + ((Height - Y) - 1) * Width * 4, Width * 4);
|
|
||||||
mem_copy(vDstData.data() + ((Height - Y) - 1) * Width * 4, pTempRow, Width * 4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1536,7 +1525,7 @@ protected:
|
||||||
|
|
||||||
[[nodiscard]] bool GetPresentedImageData(uint32_t &Width, uint32_t &Height, CImageInfo::EImageFormat &Format, std::vector<uint8_t> &vDstData) override
|
[[nodiscard]] bool GetPresentedImageData(uint32_t &Width, uint32_t &Height, CImageInfo::EImageFormat &Format, std::vector<uint8_t> &vDstData) override
|
||||||
{
|
{
|
||||||
return GetPresentedImageDataImpl(Width, Height, Format, vDstData, false, false);
|
return GetPresentedImageDataImpl(Width, Height, Format, vDstData, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************
|
/************************
|
||||||
|
@ -6768,7 +6757,7 @@ public:
|
||||||
uint32_t Width;
|
uint32_t Width;
|
||||||
uint32_t Height;
|
uint32_t Height;
|
||||||
CImageInfo::EImageFormat Format;
|
CImageInfo::EImageFormat Format;
|
||||||
if(GetPresentedImageDataImpl(Width, Height, Format, m_vScreenshotHelper, false, true))
|
if(GetPresentedImageDataImpl(Width, Height, Format, m_vScreenshotHelper, true))
|
||||||
{
|
{
|
||||||
size_t ImgSize = (size_t)Width * (size_t)Height * (size_t)4;
|
size_t ImgSize = (size_t)Width * (size_t)Height * (size_t)4;
|
||||||
pCommand->m_pImage->m_pData = malloc(ImgSize);
|
pCommand->m_pImage->m_pData = malloc(ImgSize);
|
||||||
|
|
Loading…
Reference in a new issue