SecondHalfGames/yakui

vulkan: All images are using premultiplied alpha

LPGhatguy opened this issue · 2 comments

The Vulkan backend currently only creates one pipeline for both regular graphics and for text. However, there need to be two pipelines (like the wgpu backend) so that the correct blending mode can be chosen: normally alpha blending, and premultiplied alpha blending for text.

This bug makes it so that images with alpha are rendered as much brighter than they should be with the Vulkan backend.

D'oh! Should have picked this one up sooner. We could try and be fancy and use VK_EXT_extended_dynamic_state3 to do this dynamically, but that's absolute overkill for this. Solution is just to add a second pipeline and switch between them, a-la the wgpu backend.

Alternatively, could the Vulkan backend start premultiplying all images on purpose and keep using one pipeline? 👀