Skip to content

Commit 5896bc2

Browse files
committed
Workaround timeout bug on intel devices as well
1 parent 8d7d934 commit 5896bc2

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

crates/bevy_render/src/view/window.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,20 @@ pub fn prepare_windows(
179179
render_device.configure_surface(surface, &swap_chain_descriptor);
180180
}
181181
// A recurring issue is hitting `wgpu::SurfaceError::Timeout` on certain Linux
182-
// AMD drivers. This seems to be a quirk of the driver.
183-
// We'd rather keep panicking when not on Linux AMD, because in those case,
182+
// mesa driver implementations. This seems to be a quirk of some drivers.
183+
// We'd rather keep panicking when not on Linux mesa, because in those case,
184184
// the `Timeout` is still probably the symptom of a degraded unrecoverable
185185
// application state.
186186
// see https://github.com/bevyengine/bevy/pull/5957
187+
// and https://github.com/gfx-rs/wgpu/issues/1218
187188
#[cfg(target_os = "linux")]
188-
let is_amd = || {
189+
let may_erroneously_timeout = || {
189190
render_instance
190191
.enumerate_adapters(wgpu::Backends::VULKAN)
191-
.any(|adapter| adapter.get_info().name.starts_with("AMD"))
192+
.any(|adapter| {
193+
let name = adapter.get_info().name;
194+
name.starts_with("AMD") || name.starts_with("Intel")
195+
})
192196
};
193197

194198
match surface.get_current_texture() {
@@ -203,7 +207,7 @@ pub fn prepare_windows(
203207
window.swap_chain_texture = Some(TextureView::from(frame));
204208
}
205209
#[cfg(target_os = "linux")]
206-
Err(wgpu::SurfaceError::Timeout) if is_amd() => {
210+
Err(wgpu::SurfaceError::Timeout) if may_erroneously_timeout() => {
207211
debug!(
208212
"Couldn't get swap chain texture. This is probably a quirk \
209213
of your Linux AMD GPU driver, so it can be safely ignored."

0 commit comments

Comments
 (0)