mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2024-12-04 19:23:28 +01:00
update tracy to v0.9 and adopt
This commit is contained in:
parent
cc40740cf1
commit
5004e30e18
12
external/tracy/CMakeLists.txt
vendored
12
external/tracy/CMakeLists.txt
vendored
@ -2,12 +2,12 @@ cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
|
|||||||
|
|
||||||
if(NOT EMSCRIPTEN)
|
if(NOT EMSCRIPTEN)
|
||||||
add_library(tracy_client
|
add_library(tracy_client
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/tracy/Tracy.hpp"
|
"${CMAKE_CURRENT_LIST_DIR}/tracy/public/tracy/Tracy.hpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/tracy/TracyLua.hpp"
|
"${CMAKE_CURRENT_LIST_DIR}/tracy/public/tracy/TracyLua.hpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/tracy/TracyVulkan.hpp"
|
"${CMAKE_CURRENT_LIST_DIR}/tracy/public/tracy/TracyVulkan.hpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/tracy/TracyOpenGL.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)
|
if(TRACY_ENABLE)
|
||||||
@ -18,7 +18,7 @@ if(NOT EMSCRIPTEN)
|
|||||||
|
|
||||||
target_compile_features(tracy_client PUBLIC cxx_std_17)
|
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)
|
if(UNIX)
|
||||||
target_link_libraries(tracy_client dl)
|
target_link_libraries(tracy_client dl)
|
||||||
|
2
external/tracy/tracy
vendored
2
external/tracy/tracy
vendored
@ -1 +1 @@
|
|||||||
Subproject commit f493d4aa8ba8141d9680473fad007d8a6348628e
|
Subproject commit 5a1f5371b792c12aea324213e1dc738b2923ae21
|
@ -69,11 +69,11 @@ void Engine::cleanup(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Engine::update(void) {
|
void Engine::update(void) {
|
||||||
FrameMarkStart("update")
|
FrameMarkStart("update");
|
||||||
|
|
||||||
_update_strategy->doUpdate(*this);
|
_update_strategy->doUpdate(*this);
|
||||||
|
|
||||||
FrameMarkEnd("update")
|
FrameMarkEnd("update");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
|
@ -72,7 +72,7 @@ bool Sequential::disableService(const entt::id_type service_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Sequential::doUpdate(MM::Engine& engine) {
|
void Sequential::doUpdate(MM::Engine& engine) {
|
||||||
ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate")
|
ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate");
|
||||||
// TODO: caching
|
// TODO: caching
|
||||||
std::set<update_key_t> pre_tasks;
|
std::set<update_key_t> pre_tasks;
|
||||||
std::set<update_key_t> main_tasks;
|
std::set<update_key_t> main_tasks;
|
||||||
@ -93,22 +93,22 @@ void Sequential::doUpdate(MM::Engine& engine) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{ // pre
|
{ // pre
|
||||||
ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate::pre")
|
ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate::pre");
|
||||||
doGraphSequential(engine, pre_tasks);
|
doGraphSequential(engine, pre_tasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
{ // main
|
{ // main
|
||||||
ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate::main")
|
ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate::main");
|
||||||
doGraphSequential(engine, main_tasks);
|
doGraphSequential(engine, main_tasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
{ // post
|
{ // post
|
||||||
ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate::post")
|
ZoneScopedN("MM::UpdateStrategies::Sequential::doUpdate::post");
|
||||||
doGraphSequential(engine, post_tasks);
|
doGraphSequential(engine, post_tasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
{ // simulate async
|
{ // 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++) {
|
for (size_t i = 0; !_async_queue.empty() && i < _max_async_per_tick; i++) {
|
||||||
_async_queue.back()(engine);
|
_async_queue.back()(engine);
|
||||||
_async_queue.pop_back();
|
_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()) {
|
if (!_deferred_queue.empty()) {
|
||||||
for (auto&& fn : _deferred_queue) {
|
for (auto&& fn : _deferred_queue) {
|
||||||
fn(engine);
|
fn(engine);
|
||||||
|
@ -35,7 +35,7 @@ class tracy_sink : public ::spdlog::sinks::base_sink <Mutex> {
|
|||||||
spdlog::memory_buf_t formatted;
|
spdlog::memory_buf_t formatted;
|
||||||
base_sink<Mutex>::formatter_->format(msg, formatted);
|
base_sink<Mutex>::formatter_->format(msg, formatted);
|
||||||
auto string = fmt::to_string(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 {
|
void flush_() override {
|
||||||
|
@ -92,7 +92,7 @@ glm::vec3 Camera3D::getViewDir(void) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::array<glm::vec4, 6> Camera3D::getFrustumPlanes(void) const {
|
std::array<glm::vec4, 6> Camera3D::getFrustumPlanes(void) const {
|
||||||
ZoneScopedN("Camera3D::getFrustumPlanes")
|
ZoneScopedN("Camera3D::getFrustumPlanes");
|
||||||
|
|
||||||
std::array<glm::vec4, 6> planes;
|
std::array<glm::vec4, 6> planes;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user