summaryrefslogtreecommitdiff
path: root/alligator_render/src
diff options
context:
space:
mode:
Diffstat (limited to 'alligator_render/src')
-rw-r--r--alligator_render/src/config.rs8
-rw-r--r--alligator_render/src/renderer.rs8
2 files changed, 7 insertions, 9 deletions
diff --git a/alligator_render/src/config.rs b/alligator_render/src/config.rs
index e342657..c3cc6b6 100644
--- a/alligator_render/src/config.rs
+++ b/alligator_render/src/config.rs
@@ -168,7 +168,6 @@ impl<'a> RenderWindowConfig<'a> {
&self,
supported_present_modes: &[wgpu::PresentMode],
supported_alpha_modes: &[wgpu::CompositeAlphaMode],
- supported_texture_formats: Vec<wgpu::TextureFormat>,
) -> wgpu::SurfaceConfiguration {
let present_mode = Self::present_mode(self.vsync, supported_present_modes);
let alpha_mode = Self::alpha_mode(supported_alpha_modes);
@@ -176,12 +175,15 @@ impl<'a> RenderWindowConfig<'a> {
// configuration for the surface
wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
- format: supported_texture_formats[0],
+ format: wgpu::TextureFormat::Bgra8Unorm,
width: self.default_width.get(),
height: self.default_height.get(),
alpha_mode,
present_mode,
- view_formats: supported_texture_formats,
+ view_formats: vec![
+ wgpu::TextureFormat::Bgra8Unorm,
+ wgpu::TextureFormat::Bgra8UnormSrgb,
+ ],
}
}
diff --git a/alligator_render/src/renderer.rs b/alligator_render/src/renderer.rs
index a8d7364..f5b486d 100644
--- a/alligator_render/src/renderer.rs
+++ b/alligator_render/src/renderer.rs
@@ -194,12 +194,8 @@ impl Renderer {
let capabilities = surface.get_capabilities(&adapter);
let supported_present_modes = capabilities.present_modes.into_boxed_slice();
let supported_alpha_modes = capabilities.alpha_modes.into_boxed_slice();
- let supported_texture_formats = capabilities.formats;
- let surface_config = config.to_surface_configuration(
- &supported_present_modes,
- &supported_alpha_modes,
- supported_texture_formats,
- );
+ let surface_config =
+ config.to_surface_configuration(&supported_present_modes, &supported_alpha_modes);
surface.configure(&device, &surface_config);
// create the camera