From e457bca108fa185c2102c79924cace48f0c92d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Sat, 4 Feb 2023 13:22:39 +0100 Subject: [PATCH] Use `Srgb` texture format for `TextAtlas` --- examples/hello-world.rs | 3 +-- src/text_atlas.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/hello-world.rs b/examples/hello-world.rs index b414644..3c5c6fd 100644 --- a/examples/hello-world.rs +++ b/examples/hello-world.rs @@ -49,8 +49,7 @@ async fn run() { .await .unwrap(); let surface = unsafe { instance.create_surface(&window) }; - // TODO: handle srgb - let swapchain_format = TextureFormat::Bgra8Unorm; + let swapchain_format = TextureFormat::Bgra8UnormSrgb; let mut config = SurfaceConfiguration { usage: TextureUsages::RENDER_ATTACHMENT, format: swapchain_format, diff --git a/src/text_atlas.rs b/src/text_atlas.rs index 526ff17..777f6d9 100644 --- a/src/text_atlas.rs +++ b/src/text_atlas.rs @@ -45,7 +45,7 @@ impl InnerAtlas { dimension: TextureDimension::D2, format: match num_atlas_channels { 1 => TextureFormat::R8Unorm, - 4 => TextureFormat::Rgba8Unorm, + 4 => TextureFormat::Rgba8UnormSrgb, _ => panic!("unexpected number of channels"), }, usage: TextureUsages::TEXTURE_BINDING | TextureUsages::COPY_DST,