HighMap library (C++)
Loading...
Searching...
No Matches
profiling.hpp
Go to the documentation of this file.
1#pragma once
2
3// Optional CPU instrumentation. No expressions are evaluated in normal builds.
4#ifdef HIGHMAP_ENABLE_TRACY
5#include <string_view>
6
7#include <tracy/Tracy.hpp>
8#ifndef TRACY_ENABLE
9#error HIGHMAP_ENABLE_TRACY requires a Tracy client built with TRACY_ENABLE
10#endif
11#define HMAP_PROFILE_ZONE(name) ZoneScopedN(name)
12#define HMAP_PROFILE_TEXT(text) \
13 do \
14 { \
15 if (TracyIsConnected) \
16 { \
17 const auto &hmap_profile_text = (text); \
18 const std::string_view hmap_profile_view(hmap_profile_text); \
19 ZoneText(hmap_profile_view.data(), hmap_profile_view.size()); \
20 } \
21 } while (false)
22#else
23#define HMAP_PROFILE_ZONE(name)
24#define HMAP_PROFILE_TEXT(text) \
25 do \
26 { \
27 } while (false)
28#endif