Skip to content

Commit

Permalink
Document quirky behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
nicopap committed Sep 12, 2022
1 parent 5603c8c commit 8d7d934
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/bevy_render/src/view/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use bevy_ecs::prelude::*;
use bevy_utils::{tracing::debug, HashMap, HashSet};
use bevy_window::{PresentMode, RawWindowHandleWrapper, WindowClosed, WindowId, Windows};
use std::ops::{Deref, DerefMut};
use wgpu::{Backends, TextureFormat};
use wgpu::TextureFormat;

/// Token to ensure a system runs on the main thread.
#[derive(Resource, Default)]
Expand Down Expand Up @@ -178,10 +178,16 @@ pub fn prepare_windows(
if window_surfaces.configured_windows.insert(window.id) || window.size_changed {
render_device.configure_surface(surface, &swap_chain_descriptor);
}
// A recurring issue is hitting `wgpu::SurfaceError::Timeout` on certain Linux
// AMD drivers. This seems to be a quirk of the driver.
// We'd rather keep panicking when not on Linux AMD, because in those case,
// the `Timeout` is still probably the symptom of a degraded unrecoverable
// application state.
// see https://github.com/bevyengine/bevy/pull/5957
#[cfg(target_os = "linux")]
let is_amd = || {
render_instance
.enumerate_adapters(Backends::VULKAN)
.enumerate_adapters(wgpu::Backends::VULKAN)
.any(|adapter| adapter.get_info().name.starts_with("AMD"))
};

Expand Down

0 comments on commit 8d7d934

Please sign in to comment.