SecondHalfGames / yakui

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

vulkan: Textures are not stored as sRGB #174

Closed HexyWitch closed 1 week ago

HexyWitch commented 1 week ago

Textures loaded from sRGB images look washed out using the vulkan renderer.

fn get_format(yakui_format: yakui::paint::TextureFormat) -> vk::Format {
    match yakui_format {
        yakui::paint::TextureFormat::Rgba8Srgb => vk::Format::R8G8B8A8_UNORM,
        yakui::paint::TextureFormat::R8 => vk::Format::R8_UNORM,
        _ => panic!("Unsupported texture format: {yakui_format:?}"),
    }
}

I think the right vulkan texture format is vk::Format::R8G8B8A8_SRGB