Skip to content

Commit 8d63158

Browse files
committed
default to bevy default
1 parent be3c5ef commit 8d63158

File tree

1 file changed

+2
-2
lines changed
  • crates/bevy_render/src/view/window

1 file changed

+2
-2
lines changed

crates/bevy_render/src/view/window/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::{
22
render_resource::{PipelineCache, SpecializedRenderPipelines, SurfaceTexture, TextureView},
33
renderer::{RenderAdapter, RenderDevice, RenderInstance},
4-
texture::TextureFormatPixelInfo,
4+
texture::{BevyDefault, TextureFormatPixelInfo},
55
Extract, ExtractSchedule, Render, RenderApp, RenderSet,
66
};
77
use bevy_app::{App, Plugin};
@@ -245,7 +245,7 @@ pub fn prepare_windows(
245245
// For future HDR output support, we'll need to request a format that supports HDR,
246246
// but as of wgpu 0.15 that is not yet supported.
247247
// Prefer sRGB formats for surfaces, but fall back to first available format if no sRGB formats are available.
248-
let mut format = *formats.get(0).expect("No supported formats for surface");
248+
let mut format = *formats.get(0).unwrap_or(&TextureFormat::bevy_default());
249249
for available_format in formats {
250250
// Rgba8UnormSrgb and Bgra8UnormSrgb and the only sRGB formats wgpu exposes that we can use for surfaces.
251251
if available_format == TextureFormat::Rgba8UnormSrgb

0 commit comments

Comments
 (0)