Vulkan: Fixed capture buffer size. (#3783)

captureSize used m_width for the row count, but the swap-chain readback
copies m_height rows (capture() reports _size = height * pitch, and
ReadbackVK::pitch() is width * bpp/8). A backbuffer taller than wide
under-allocates the readback buffer and overruns it. Use m_height, which
matches the GL backend's width*height*4.
This commit is contained in:
Kyle Emmerich
2026-06-25 11:43:37 -04:00
committed by GitHub
parent 07fcf2a577
commit c9bb37b668

View File

@@ -3004,7 +3004,7 @@ VK_IMPORT_DEVICE
{
const uint8_t bpp = bimg::getBitsPerPixel(bimg::TextureFormat::Enum(m_backBuffer.m_swapChain.m_colorFormat) );
const uint32_t pitch = m_backBuffer.m_width * bpp / 8;
const uint32_t captureSize = m_backBuffer.m_width * pitch;
const uint32_t captureSize = m_backBuffer.m_height * pitch;
if (captureSize > m_captureSize)
{