add span to winit event handler (#6612)
# Objective - Add a span for the winit event handler. I've found this useful in my PR for pipelined rendering and I've seen it come up in a few other contexts now. 
This commit is contained in:
parent
eaa35cf99f
commit
8ebd4d909c
@ -16,7 +16,8 @@ trace = [
|
||||
"bevy_ecs/trace",
|
||||
"bevy_log/trace",
|
||||
"bevy_render?/trace",
|
||||
"bevy_hierarchy/trace"
|
||||
"bevy_hierarchy/trace",
|
||||
"bevy_winit/trace"
|
||||
]
|
||||
trace_chrome = [ "bevy_log/tracing-chrome" ]
|
||||
trace_tracy = ["bevy_render?/tracing-tracy", "bevy_log/tracing-tracy" ]
|
||||
|
@ -9,6 +9,7 @@ license = "MIT OR Apache-2.0"
|
||||
keywords = ["bevy"]
|
||||
|
||||
[features]
|
||||
trace = []
|
||||
wayland = ["winit/wayland"]
|
||||
x11 = ["winit/x11"]
|
||||
|
||||
|
@ -360,6 +360,8 @@ pub fn winit_runner_with(mut app: App) {
|
||||
let event_handler = move |event: Event<()>,
|
||||
event_loop: &EventLoopWindowTarget<()>,
|
||||
control_flow: &mut ControlFlow| {
|
||||
#[cfg(feature = "trace")]
|
||||
let _span = bevy_utils::tracing::info_span!("winit event_handler").entered();
|
||||
match event {
|
||||
event::Event::NewEvents(start) => {
|
||||
let winit_config = app.world.resource::<WinitSettings>();
|
||||
|
Loading…
Reference in New Issue
Block a user