diff --git a/voxygen/src/scene/mod.rs b/voxygen/src/scene/mod.rs index 50ef89f52f..365c5a0490 100644 --- a/voxygen/src/scene/mod.rs +++ b/voxygen/src/scene/mod.rs @@ -33,7 +33,7 @@ use common::{ terrain::{BlockKind, TerrainChunk}, vol::ReadVol, }; -use common_base::span; +use common_base::{prof_span, span}; use common_state::State; use comp::item::Reagent; use hashbrown::HashMap; @@ -1064,6 +1064,7 @@ impl Scene { // would instead have this as an extension. if drawer.render_mode().shadow.is_map() && (is_daylight || !self.light_data.is_empty()) { if is_daylight { + prof_span!("directed shadows"); if let Some(mut shadow_pass) = drawer.shadow_pass() { // Render terrain directed shadows. self.terrain @@ -1080,12 +1081,16 @@ impl Scene { } // Render terrain point light shadows. - drawer.draw_point_shadows( - &self.data.point_light_matrices, - self.terrain.chunks_for_point_shadows(focus_pos), - ) + { + prof_span!("point shadows"); + drawer.draw_point_shadows( + &self.data.point_light_matrices, + self.terrain.chunks_for_point_shadows(focus_pos), + ) + } } + prof_span!(guard, "main pass"); if let Some(mut first_pass) = drawer.first_pass() { self.figure_mgr.render_player( &mut first_pass.draw_figures(), @@ -1125,6 +1130,7 @@ impl Scene { // Render debug shapes self.debug.render(&mut first_pass.draw_debug()); } + drop(guard); } pub fn maintain_debug_hitboxes( diff --git a/voxygen/src/session/mod.rs b/voxygen/src/session/mod.rs index d4e2e4cb39..2e7464f658 100644 --- a/voxygen/src/session/mod.rs +++ b/voxygen/src/session/mod.rs @@ -27,7 +27,7 @@ use common::{ }, vol::ReadVol, }; -use common_base::span; +use common_base::{prof_span, span}; use common_net::{ msg::{server::InviteAnswer, PresenceKind}, sync::WorldSyncExt, @@ -1444,16 +1444,22 @@ impl PlayState for SessionState { } // Clouds - if let Some(mut second_pass) = drawer.second_pass() { - second_pass.draw_clouds(); + { + prof_span!("clouds"); + if let Some(mut second_pass) = drawer.second_pass() { + second_pass.draw_clouds(); + } } // PostProcess and UI - let mut third_pass = drawer.third_pass(); - third_pass.draw_postprocess(); - // Draw the UI to the screen - if let Some(mut ui_drawer) = third_pass.draw_ui() { - self.hud.render(&mut ui_drawer); - }; // Note: this semicolon is needed for the third_pass borrow to be dropped before it's lifetime ends + { + prof_span!("post-process and ui"); + let mut third_pass = drawer.third_pass(); + third_pass.draw_postprocess(); + // Draw the UI to the screen + if let Some(mut ui_drawer) = third_pass.draw_ui() { + self.hud.render(&mut ui_drawer); + }; // Note: this semicolon is needed for the third_pass borrow to be dropped before it's lifetime ends + } } }