mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 13:50:04 -04:00
Reduce warning level on occluded error
This commit is contained in:
@@ -348,13 +348,21 @@ impl Default for WgpuConfiguration {
|
|||||||
// `WgpuSetup::from_display_handle(...)` before creating the instance if one is available.
|
// `WgpuSetup::from_display_handle(...)` before creating the instance if one is available.
|
||||||
wgpu_setup: WgpuSetup::without_display_handle(),
|
wgpu_setup: WgpuSetup::without_display_handle(),
|
||||||
on_surface_status: Arc::new(|status| {
|
on_surface_status: Arc::new(|status| {
|
||||||
if matches!(status, wgpu::CurrentSurfaceTexture::Outdated) {
|
match status {
|
||||||
// This error occurs when the app is minimized on Windows.
|
wgpu::CurrentSurfaceTexture::Outdated => {
|
||||||
// Silently return here to prevent spamming the console with:
|
// This error occurs when the app is minimized on Windows.
|
||||||
// "The underlying surface has changed, and therefore the swap chain must be updated"
|
// Silently return here to prevent spamming the console with:
|
||||||
} else {
|
// "The underlying surface has changed, and therefore the swap chain must be updated"
|
||||||
log::warn!("Dropped frame with error: {status:?}");
|
}
|
||||||
|
wgpu::CurrentSurfaceTexture::Occluded => {
|
||||||
|
// This error occurs when the application is occluded (e.g. minimized or behind another window).
|
||||||
|
log::debug!("Dropped frame with error: {status:?}");
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
log::warn!("Dropped frame with error: {status:?}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SurfaceErrorAction::SkipFrame
|
SurfaceErrorAction::SkipFrame
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user