Use CMake FetchContent to pull tracy sources and build it if frame tracing is enabled. As frame tracing requires annotations in the code, create a wrapper that replaces them with our own defines that are empty when tracing is not enabled.
24 lines
552 B
C
24 lines
552 B
C
//
|
|
// Created by trotfunky on 05/02/24.
|
|
//
|
|
|
|
#ifndef RAYCASTING_FRAMETRACING_H
|
|
#define RAYCASTING_FRAMETRACING_H
|
|
|
|
/*
|
|
* Basic wrapper to allow enabling and disabling frame tracing using
|
|
* Tracy.
|
|
* https://github.com/wolfpld/tracy
|
|
*/
|
|
#ifdef TRACE_FRAMES
|
|
#include "tracy/Tracy.hpp"
|
|
#define FTrace_FrameMark FrameMark
|
|
#define FTrace_Scope ZoneScoped
|
|
#define FTrace_NamedScope(name) ZoneScopedN(name)
|
|
#else
|
|
#define FTrace_FrameMark
|
|
#define FTrace_Scope
|
|
#define FTrace_NamedScope(name)
|
|
#endif /* TRACE_FRAMES */
|
|
|
|
#endif //RAYCASTING_FRAMETRACING_H
|