From c9bb37b668cb06e74da4752be9bccb5722b7cb71 Mon Sep 17 00:00:00 2001 From: Kyle Emmerich Date: Thu, 25 Jun 2026 11:43:37 -0400 Subject: [PATCH] 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. --- src/renderer_vk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer_vk.cpp b/src/renderer_vk.cpp index 4bff6a662..e5a97e233 100644 --- a/src/renderer_vk.cpp +++ b/src/renderer_vk.cpp @@ -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) {