Use finish_continuous_frame directly

This commit is contained in:
Imbris 2020-08-29 03:00:26 -04:00
parent 63d60c212c
commit 0683a40741
7 changed files with 15 additions and 9 deletions

View File

@ -6,6 +6,8 @@ rustflags = [
[alias]
generate = "run --package tools --"
test-server = "-Zpackage-features run --bin veloren-server-cli --no-default-features"
tracy-server = "-Zunstable-options -Zpackage-features run --bin veloren-server-cli --no-default-features --features tracy --profile no_overflow"
test-voxygen = "-Zpackage-features run --bin veloren-voxygen --no-default-features --features gl"
tracy-voxygen = "-Zunstable-options -Zpackage-features run --bin veloren-voxygen --no-default-features --features tracy gl --profile no_overflow"
server = "run --bin veloren-server-cli"

1
Cargo.lock generated
View File

@ -5040,7 +5040,6 @@ dependencies = [
"tracing-log",
"tracing-subscriber",
"tracing-tracy",
"tracy-client",
"treeculler",
"uvth 3.1.1",
"vek 0.12.0",

View File

@ -11,6 +11,8 @@ lazy_static::lazy_static! {
pub use color::*;
pub use dir::*;
#[cfg(feature = "tracy")] pub use tracy_client;
// https://discordapp.com/channels/676678179678715904/676685797524766720/723358438943621151
#[macro_export]
macro_rules! span {

View File

@ -12,9 +12,9 @@ use crate::{
use common::clock::Clock;
use server::{Event, Input, Server, ServerSettings};
use tracing::{info, Level};
use tracing_subscriber::{
filter::LevelFilter, layer::SubscriberExt, prelude::*, EnvFilter, FmtSubscriber,
};
use tracing_subscriber::{filter::LevelFilter, EnvFilter, FmtSubscriber};
#[cfg(feature = "tracy")]
use tracing_subscriber::{layer::SubscriberExt, prelude::*};
use clap::{App, Arg};
use std::{io, sync::mpsc, time::Duration};
@ -77,6 +77,8 @@ fn main() -> io::Result<()> {
.init();
#[cfg(not(feature = "tracy"))]
// TODO: when tracing gets per Layer filters re-enable this when the tracy feature is being
// used (and do the same in voxygen)
{
let subscriber = FmtSubscriber::builder()
.with_max_level(Level::ERROR)
@ -122,7 +124,8 @@ fn main() -> io::Result<()> {
// Clean up the server after a tick.
server.cleanup();
tracing::trace!(tracy.frame_mark = true);
#[cfg(feature = "tracy")]
common::util::tracy_client::finish_continuous_frame!();
match msg_r.try_recv() {
Ok(msg) => match msg {

View File

@ -4,7 +4,6 @@ use crate::{
persistence::character::CharacterLoader, ServerSettings,
};
use common::{
span,
comp::{
Admin, AdminList, CanBuild, ChatMode, ChatType, ControlEvent, Controller, ForceUpdate, Ori,
Player, Pos, Stats, UnresolvedChatMsg, Vel,
@ -14,6 +13,7 @@ use common::{
validate_chat_msg, CharacterInfo, ChatMsgValidationError, ClientMsg, ClientState,
PlayerInfo, PlayerListUpdate, RequestStateError, ServerMsg, MAX_BYTES_CHAT_MSG,
},
span,
state::{BlockChange, Time},
sync::Uid,
terrain::{Block, TerrainChunkSize, TerrainGrid},

View File

@ -12,7 +12,7 @@ version = "0.7.0"
gl = ["gfx_device_gl", "gfx_gl"]
hot-anim = ["anim/use-dyn-lib"]
singleplayer = ["server"]
tracy = ["tracing-tracy", "tracy-client", "common/tracy"]
tracy = ["tracing-tracy", "common/tracy"]
tweak = ["const-tweaker"]
default = ["gl", "singleplayer", "msgbox"]
@ -84,7 +84,6 @@ tracing-subscriber = {version = "0.2.3", default-features = false, features = ["
# Tracy
tracing-tracy = { version = "0.2.0", optional = true }
tracy-client = { version = "0.8.0", optional = true }
[target.'cfg(target_os = "macos")'.dependencies]
dispatch = "0.1.4"

View File

@ -162,7 +162,8 @@ fn handle_main_events_cleared(
.swap_buffers()
.expect("Failed to swap window buffers!");
drop(guard);
tracing::trace!(tracy.frame_mark = true);
#[cfg(feature = "tracy")]
common::util::tracy_client::finish_continuous_frame!();
}
if !exit {