VK_FORMAT_BC1_RGB_UNORM_BLOCK has no alpha component, so sampling a BC1
texture on Vulkan always returns a = 1.0 and the 1-bit punch-through
alpha of the source data is silently discarded.
This contradicts bgfx's own definition of the format - bgfx.h documents
TextureFormat::BC1 as "5-bit R, 6-bit G, 5-bit B, 1-bit A" - and it
disagrees with every other backend:
D3D11/D3D12 DXGI_FORMAT_BC1_UNORM
OpenGL GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
all of which decode the punch-through alpha. There is no separate BC1A
format in bgfx, so the RGB variant is not an intentional distinction.
Switching to the RGBA variants costs nothing in terms of support: if
textureCompressionBC is available, the specification requires all of
BC1-BC7 with the same feature set, so VK_FORMAT_BC1_RGBA_UNORM_BLOCK is
available wherever VK_FORMAT_BC1_RGB_UNORM_BLOCK is. Fully opaque BC1
blocks decode identically under both.
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.
Acquiring waited forever for an image on every swap chain from the one
submit thread, so a single swap chain that is no longer served (e.g. a
fully occluded window on a Wayland compositor without fifo-v1, which
stops releasing buffers) stalled rendering of all windows. Window swap
chains now acquire without blocking and are skipped for the frame when
no image is available; only the main back buffer may block, as that is
the frame pacing. Image availability acts as natural back pressure, no
compositor specific behavior is needed.
When acquiring a window frame buffer swap chain returns
VK_SUBOPTIMAL_KHR or VK_ERROR_OUT_OF_DATE_KHR it is flagged with
m_needToRecreateSwapchain and acquire then refuses forever: only the
main back buffer is recreated (by updateResolution), so the window
permanently stops updating (easily triggered by moving the window to a
display with a different scale). Recreate flagged window swap chains
when acquiring them.