SecondHalfGames / yakui

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

vulkan: All images are using premultiplied alpha #161

Open LPGhatguy opened 6 months ago

LPGhatguy commented 6 months 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 6 months 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 4 months ago

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