Use Srgb
texture format for TextAtlas
This commit is contained in:
parent
2af2f357c5
commit
e457bca108
2 changed files with 2 additions and 3 deletions
|
@ -49,8 +49,7 @@ async fn run() {
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let surface = unsafe { instance.create_surface(&window) };
|
let surface = unsafe { instance.create_surface(&window) };
|
||||||
// TODO: handle srgb
|
let swapchain_format = TextureFormat::Bgra8UnormSrgb;
|
||||||
let swapchain_format = TextureFormat::Bgra8Unorm;
|
|
||||||
let mut config = SurfaceConfiguration {
|
let mut config = SurfaceConfiguration {
|
||||||
usage: TextureUsages::RENDER_ATTACHMENT,
|
usage: TextureUsages::RENDER_ATTACHMENT,
|
||||||
format: swapchain_format,
|
format: swapchain_format,
|
||||||
|
|
|
@ -45,7 +45,7 @@ impl InnerAtlas {
|
||||||
dimension: TextureDimension::D2,
|
dimension: TextureDimension::D2,
|
||||||
format: match num_atlas_channels {
|
format: match num_atlas_channels {
|
||||||
1 => TextureFormat::R8Unorm,
|
1 => TextureFormat::R8Unorm,
|
||||||
4 => TextureFormat::Rgba8Unorm,
|
4 => TextureFormat::Rgba8UnormSrgb,
|
||||||
_ => panic!("unexpected number of channels"),
|
_ => panic!("unexpected number of channels"),
|
||||||
},
|
},
|
||||||
usage: TextureUsages::TEXTURE_BINDING | TextureUsages::COPY_DST,
|
usage: TextureUsages::TEXTURE_BINDING | TextureUsages::COPY_DST,
|
||||||
|
|
Loading…
Reference in a new issue