mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-10-25 10:20:52 +00:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user