render/vulkan: allow rendering to RGB565 (and other non-8-bit) buffers
For RGB565 formats, this MR uses a different render pass structure, in which rendering is first performed onto a (linear), half-float buffer, and then a second subpass draws this onto the (sRGB) render buffer. This is similar to what Weston does with its shadow framebuffer.
Suggestions for better variable names are welcome. The linear_image
variable introduced here could also be called a shadow_image
, pcs_image
, or blending_image
.
To test this code, run a compositor which calls wlr_output_set_render_format
with DRM_FORMAT_RGB565. I use a branch of sway (mstoeckl/extra-bit-depths) for which swaymsg output '*' render_bit_depth 5
will do this at runtime.
This may also be useful as a starting point for color management with Vulkan.