Improve rendering spans for tracy

This commit is contained in:
Imbris 2021-06-19 04:25:39 -04:00
parent 315ab872f5
commit 83c49895ae
2 changed files with 26 additions and 14 deletions

View File

@ -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.
{
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(

View File

@ -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,10 +1444,15 @@ impl PlayState for SessionState {
}
// Clouds
{
prof_span!("clouds");
if let Some(mut second_pass) = drawer.second_pass() {
second_pass.draw_clouds();
}
}
// PostProcess and UI
{
prof_span!("post-process and ui");
let mut third_pass = drawer.third_pass();
third_pass.draw_postprocess();
// Draw the UI to the screen
@ -1455,6 +1460,7 @@ impl PlayState for SessionState {
self.hud.render(&mut ui_drawer);
}; // Note: this semicolon is needed for the third_pass borrow to be dropped before it's lifetime ends
}
}
}
/// Max distance an entity can be "targeted"