summaryrefslogtreecommitdiff
path: root/alligator_render
diff options
context:
space:
mode:
authorMicha White <botahamec@outlook.com>2023-02-04 11:41:22 -0500
committerMicha White <botahamec@outlook.com>2023-02-04 11:41:22 -0500
commite838982d1abe4134f83a3f4e9db0a3bfb8ebc926 (patch)
tree3c13a7de2e3089de1d25f369aec69f23d075a38e /alligator_render
parent3201cf932ac9d6568b57433e47e7aaf68453b568 (diff)
Fix colors
Diffstat (limited to 'alligator_render')
-rw-r--r--alligator_render/src/config.rs6
-rw-r--r--alligator_render/src/renderer.rs3
-rw-r--r--alligator_render/src/texture.rs2
3 files changed, 6 insertions, 5 deletions
diff --git a/alligator_render/src/config.rs b/alligator_render/src/config.rs
index b289212..952e885 100644
--- a/alligator_render/src/config.rs
+++ b/alligator_render/src/config.rs
@@ -166,7 +166,7 @@ impl<'a> RenderWindowConfig<'a> {
&self,
supported_present_modes: &[wgpu::PresentMode],
supported_alpha_modes: &[wgpu::CompositeAlphaMode],
- texture_format: wgpu::TextureFormat,
+ 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);
@@ -174,12 +174,12 @@ impl<'a> RenderWindowConfig<'a> {
// configuration for the surface
wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
- format: texture_format,
+ format: supported_texture_formats[0],
width: self.default_width.get(),
height: self.default_height.get(),
alpha_mode,
present_mode,
- view_formats: vec![texture_format],
+ view_formats: supported_texture_formats,
}
}
diff --git a/alligator_render/src/renderer.rs b/alligator_render/src/renderer.rs
index 98c772a..a7d952a 100644
--- a/alligator_render/src/renderer.rs
+++ b/alligator_render/src/renderer.rs
@@ -184,10 +184,11 @@ 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,
- capabilities.formats[0],
+ supported_texture_formats,
);
surface.configure(&device, &surface_config);
diff --git a/alligator_render/src/texture.rs b/alligator_render/src/texture.rs
index e2021f8..b60eade 100644
--- a/alligator_render/src/texture.rs
+++ b/alligator_render/src/texture.rs
@@ -116,7 +116,7 @@ impl TextureAtlas {
mip_level_count: 1,
sample_count: 1,
dimension: wgpu::TextureDimension::D2,
- format: wgpu::TextureFormat::Rgba8UnormSrgb,
+ format: wgpu::TextureFormat::Rgba8Unorm,
usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST,
view_formats: &[wgpu::TextureFormat::Rgba8UnormSrgb],
});