Skip to content

render/vulkan: allow rendering to RGB565 (and other non-8-bit) buffers

M. Stoeckl requested to merge mstoeckl/wlroots:vk-output-5 into master

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.

Edited by M. Stoeckl

Merge request reports