From 5004e30e18e1e284a924e76bb531528fd0e7463c Mon Sep 17 00:00:00 2001 From: Green Sky Date: Thu, 27 Oct 2022 16:36:40 +0200 Subject: [PATCH] update tracy to v0.9 and adopt --- external/tracy/CMakeLists.txt | 12 ++++++------ external/tracy/tracy | 2 +- framework/engine/src/mm/engine.cpp | 4 ++-- .../src/mm/update_strategies/sequential_strategy.cpp | 12 ++++++------ framework/logger/src/mm/tracy_sink.hpp | 2 +- .../opengl_renderer/src/mm/opengl/camera_3d.cpp | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/external/tracy/CMakeLists.txt b/external/tracy/CMakeLists.txt index 83e6a04..16d573f 100644 --- a/external/tracy/CMakeLists.txt +++ b/external/tracy/CMakeLists.txt @@ -2,12 +2,12 @@ cmake_minimum_required(VERSION 3.9 FATAL_ERROR) if(NOT EMSCRIPTEN) add_library(tracy_client - "${CMAKE_CURRENT_LIST_DIR}/tracy/Tracy.hpp" - "${CMAKE_CURRENT_LIST_DIR}/tracy/TracyLua.hpp" - "${CMAKE_CURRENT_LIST_DIR}/tracy/TracyVulkan.hpp" - "${CMAKE_CURRENT_LIST_DIR}/tracy/TracyOpenGL.hpp" + "${CMAKE_CURRENT_LIST_DIR}/tracy/public/tracy/Tracy.hpp" + "${CMAKE_CURRENT_LIST_DIR}/tracy/public/tracy/TracyLua.hpp" + "${CMAKE_CURRENT_LIST_DIR}/tracy/public/tracy/TracyVulkan.hpp" + "${CMAKE_CURRENT_LIST_DIR}/tracy/public/tracy/TracyOpenGL.hpp" - "${CMAKE_CURRENT_LIST_DIR}/tracy/TracyClient.cpp" + "${CMAKE_CURRENT_LIST_DIR}/tracy/public/TracyClient.cpp" ) if(TRACY_ENABLE) @@ -18,7 +18,7 @@ if(NOT EMSCRIPTEN) target_compile_features(tracy_client PUBLIC cxx_std_17) - target_include_directories(tracy_client PUBLIC "${CMAKE_CURRENT_LIST_DIR}") + target_include_directories(tracy_client PUBLIC "${CMAKE_CURRENT_LIST_DIR}/tracy/public") if(UNIX) target_link_libraries(tracy_client dl) diff --git a/external/tracy/tracy b/external/tracy/tracy index f493d4a..5a1f537 160000 --- a/external/tracy/tracy +++ b/external/tracy/tracy @@ -1 +1 @@ -Subproject commit f493d4aa8ba8141d9680473fad007d8a6348628e +Subproject commit 5a1f5371b792c12aea324213e1dc738b2923ae21 diff --git a/framework/engine/src/mm/engine.cpp b/framework/engine/src/mm/engine.cpp index 07e5ec5..f257450 100644 --- a/framework/engine/src/mm/engine.cpp +++ b/framework/engine/src/mm/engine.cpp @@ -69,11 +69,11 @@ void Engine::cleanup(void) { } void Engine::update(void) { - FrameMarkStart("update") + FrameMarkStart("update"); _update_strategy->doUpdate(*this); - FrameMarkEnd("update") + FrameMarkEnd("update"); } #ifdef __EMSCRIPTEN__ diff --git a/framework/engine/src/mm/update_strategies/sequential_strategy.cpp b/framework/engine/src/mm/update_strategies/sequential_strategy.cpp index d68d0f2..d25a240 100644 --- a/framework/engine/src/mm/update_strategies/sequential_strategy.cpp +++ b/framework/engine/src/mm/update_strategies/sequential_strategy.cpp @@ -72,7 +72,7 @@ bool Sequential::disableService(const entt::id_type service_id) { } void Sequential::doUpdate(MM::Engine& engine) { - ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate") + ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate"); // TODO: caching std::set pre_tasks; std::set main_tasks; @@ -93,22 +93,22 @@ void Sequential::doUpdate(MM::Engine& engine) { } { // pre - ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate::pre") + ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate::pre"); doGraphSequential(engine, pre_tasks); } { // main - ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate::main") + ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate::main"); doGraphSequential(engine, main_tasks); } { // post - ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate::post") + ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate::post"); doGraphSequential(engine, post_tasks); } { // simulate async - ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate::async") + ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate::async"); for (size_t i = 0; !_async_queue.empty() && i < _max_async_per_tick; i++) { _async_queue.back()(engine); _async_queue.pop_back(); @@ -116,7 +116,7 @@ void Sequential::doUpdate(MM::Engine& engine) { } { - ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate::deferred") + ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate::deferred"); if (!_deferred_queue.empty()) { for (auto&& fn : _deferred_queue) { fn(engine); diff --git a/framework/logger/src/mm/tracy_sink.hpp b/framework/logger/src/mm/tracy_sink.hpp index b19fcd5..db863e6 100644 --- a/framework/logger/src/mm/tracy_sink.hpp +++ b/framework/logger/src/mm/tracy_sink.hpp @@ -35,7 +35,7 @@ class tracy_sink : public ::spdlog::sinks::base_sink { spdlog::memory_buf_t formatted; base_sink::formatter_->format(msg, formatted); auto string = fmt::to_string(formatted); - TracyMessageC(string.data(), string.size(), level_to_color(msg.level)) + TracyMessageC(string.data(), string.size(), level_to_color(msg.level)); } void flush_() override { diff --git a/framework/opengl_renderer/src/mm/opengl/camera_3d.cpp b/framework/opengl_renderer/src/mm/opengl/camera_3d.cpp index 882f9a2..06c7771 100644 --- a/framework/opengl_renderer/src/mm/opengl/camera_3d.cpp +++ b/framework/opengl_renderer/src/mm/opengl/camera_3d.cpp @@ -92,7 +92,7 @@ glm::vec3 Camera3D::getViewDir(void) const { } std::array Camera3D::getFrustumPlanes(void) const { - ZoneScopedN("Camera3D::getFrustumPlanes") + ZoneScopedN("Camera3D::getFrustumPlanes"); std::array planes;