SecondHalfGames / yakui

yakui is a declarative Rust UI library for games
Apache License 2.0
222 stars 18 forks source link

vulkan: All images are using premultiplied alpha #161

Open LPGhatguy opened 1 month ago

LPGhatguy commented 1 month ago

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.

kanerogers commented 1 month ago

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.

LPGhatguy commented 1 week ago

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