Skip to content

Commit

Permalink
Add env TRACY_NO_INVARIANT_CHECK=1
Browse files Browse the repository at this point in the history
  • Loading branch information
illidanstormrange committed Nov 22, 2024
1 parent b86de17 commit af8f586
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ if (TGFX_ENABLE_PROFILING)
list(APPEND TGFX_INCLUDES third_party/tracy)
list(APPEND TGFX_DEFINES TGFX_ENABLE_PROFILING)
set(TRACY_ENABLE ON)
list(APPEND TGFX_COMPILE_OPTIONS -DTRACY_NO_INVARIANT_CHECK=1)
endif ()

list(APPEND TGFX_STATIC_VENDORS pathkit)
Expand Down
8 changes: 8 additions & 0 deletions src/core/utils/Profiling.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
#include "public/common/TracySystem.hpp"
#include "public/tracy/Tracy.hpp"

struct TracyENV {
TracyENV() {
setenv("TRACY_NO_INVARIANT_CHECK", "1", 1);
}
};

static TracyENV tracyENV;

#define TRACE_EVENT(name) ZoneScopedN(name)
#define TRACE_EVENT_COLOR(name, color) ZoneScopedNC(name, color)

Expand Down

0 comments on commit af8f586

Please sign in to comment.