Fix egui-wgpu performance regression (#3580)
Introduced in the recent multi-viewports work, we accidentally recreated the wgpu surfaces every frame. This is now fixed. I found this while improving the profiling of `eframe`
This commit is contained in:
@@ -100,3 +100,18 @@ pub fn system_theme(window: &Window, options: &crate::NativeOptions) -> Option<c
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
/// Short and fast description of an event.
|
||||
/// Useful for logging and profiling.
|
||||
pub fn short_event_description(event: &winit::event::Event<'_, UserEvent>) -> &'static str {
|
||||
use winit::event::Event;
|
||||
|
||||
match event {
|
||||
Event::UserEvent(user_event) => match user_event {
|
||||
UserEvent::RequestRepaint { .. } => "UserEvent::RequestRepaint",
|
||||
#[cfg(feature = "accesskit")]
|
||||
UserEvent::AccessKitActionRequest(_) => "UserEvent::AccessKitActionRequest",
|
||||
},
|
||||
_ => egui_winit::short_generic_event_description(event),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user