mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Improve rendering spans for tracy
This commit is contained in:
parent
315ab872f5
commit
83c49895ae
@ -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(
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user