Fix window format to Bgra8Unorm (fixes unnecessary sRGB conversion)

This commit is contained in:
mars 2022-11-18 16:57:39 -07:00
parent 0bf02ba93b
commit d5e9e229dc
2 changed files with 2 additions and 6 deletions

View File

@ -65,15 +65,11 @@ impl Window {
let surface = unsafe { instance.create_surface(&window) };
let last_update = Instant::now();
let format = *surface
.get_supported_formats(&adapter)
.first()
.ok_or(anyhow!("Could not find surface format for new window"))?;
let size = window.inner_size();
let surface_config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
format,
format: wgpu::TextureFormat::Bgra8Unorm,
width: size.width,
height: size.height,
present_mode: wgpu::PresentMode::Fifo,

View File

@ -83,7 +83,7 @@ impl Renderer {
module: &shader,
entry_point: "fs_main",
targets: &[Some(ColorTargetState {
format: TextureFormat::Bgra8UnormSrgb,
format: TextureFormat::Bgra8Unorm,
blend: Some(BlendState::ALPHA_BLENDING),
write_mask: ColorWrites::ALL,
})],