@@ -16,7 +16,7 @@ Project: The Dark Mod (http://www.thedarkmod.com/)
16
16
#pragma once
17
17
18
18
#include " renderer/backend/qgl/qgl.h"
19
- #include < TracyOpenGL.hpp>
19
+ #include < tracy/ TracyOpenGL.hpp>
20
20
#include < common/TracySystem.hpp>
21
21
22
22
extern idCVar r_useDebugGroups;
@@ -33,47 +33,45 @@ extern bool g_tracingAllocStacks;
33
33
extern bool g_glTraceInitialized;
34
34
35
35
#define TRACE_THREAD_NAME ( name ) if ( g_tracingEnabled ) tracy::SetThreadName( name );
36
- #define TRACE_PLOT_NUMBER ( name, value ) if ( g_tracingEnabled ) { TracyPlot ( name, value ); TracyPlotConfig ( name, tracy::PlotFormatType::Number ); }
37
- #define TRACE_PLOT_BYTES ( name, value ) if ( g_tracingEnabled ) { TracyPlot ( name, value ); TracyPlotConfig ( name, tracy::PlotFormatType::Memory ); }
38
- #define TRACE_PLOT_FRACTION ( name, value ) if ( g_tracingEnabled ) { TracyPlot ( name, value*100 ); TracyPlotConfig ( name, tracy::PlotFormatType::Percentage ); }
36
+ #define TRACE_PLOT_SMOOTH_FRACTION ( name, value ) if ( g_tracingEnabled ) { TracyPlot ( name, value*100 ); TracyPlotConfig ( name, tracy::PlotFormatType::Percentage, true , true , 0 ); }
39
37
40
38
#define TRACE_COLOR_IDLE 0x808080
41
39
42
40
// zones/scopes to measure and display as interval task
43
- #define TRACE_CPU_SCOPE ( section ) ZoneNamedN( __tracy_scoped_zone, section, g_tracingEnabled )
44
- #define TRACE_CPU_SCOPE_COLOR ( section, color ) ZoneNamedNC( __tracy_scoped_zone, section, color, g_tracingEnabled )
41
+ #define TRACE_CPU_SCOPE ( section ) ZoneNamedN( __tracy_scoped_zone, section, g_tracingEnabled );
42
+ #define TRACE_CPU_SCOPE_COLOR ( section, color ) ZoneNamedNC( __tracy_scoped_zone, section, color, g_tracingEnabled );
45
43
46
44
// set text of the currently active zone (overwrite)
47
45
#define TRACE_ATTACH_TEXT ( text ) if ( g_tracingEnabled ) { \
48
46
const char *__tmp_cstr = text; \
49
- ZoneTextV ( __tracy_scoped_zone, __tmp_cstr, strlen (__tmp_cstr) ) \
47
+ ZoneTextV ( __tracy_scoped_zone, __tmp_cstr, strlen (__tmp_cstr) ); \
50
48
}
51
49
#define TRACE_ATTACH_STR ( text ) if ( g_tracingEnabled ) { \
52
50
const idStr &__tmp_str = text; \
53
- ZoneTextV ( __tracy_scoped_zone, __tmp_str.c_str (), __tmp_str.Length () ) \
51
+ ZoneTextV ( __tracy_scoped_zone, __tmp_str.c_str (), __tmp_str.Length () ); \
54
52
}
55
53
#define TRACE_ATTACH_FORMAT ( ... ) if ( g_tracingEnabled ) { \
56
54
char __tracy_scoped_buffer[1024 ]; \
57
55
int __tracy_scoped_len = idStr::snPrintf (__tracy_scoped_buffer, 1024 , __VA_ARGS__); \
58
- ZoneTextV ( __tracy_scoped_zone, __tracy_scoped_buffer, __tracy_scoped_len ) \
56
+ ZoneTextV ( __tracy_scoped_zone, __tracy_scoped_buffer, __tracy_scoped_len ); \
59
57
}
60
58
61
59
// create zone with text attached immediately
62
60
#define TRACE_CPU_SCOPE_TEXT ( section, text_cstr ) \
63
- TRACE_CPU_SCOPE ( section ) \
64
- TRACE_ATTACH_TEXT( text_cstr )
61
+ TRACE_CPU_SCOPE ( section ); \
62
+ TRACE_ATTACH_TEXT ( text_cstr );
65
63
#define TRACE_CPU_SCOPE_STR ( section, text_idstr ) \
66
- TRACE_CPU_SCOPE ( section ) \
67
- TRACE_ATTACH_STR( text_idstr )
64
+ TRACE_CPU_SCOPE ( section ); \
65
+ TRACE_ATTACH_STR ( text_idstr );
68
66
#define TRACE_CPU_SCOPE_FORMAT ( section, ... ) \
69
- TRACE_CPU_SCOPE ( section ) \
70
- TRACE_ATTACH_FORMAT( __VA_ARGS__ )
67
+ TRACE_CPU_SCOPE ( section ); \
68
+ TRACE_ATTACH_FORMAT ( __VA_ARGS__ );
71
69
72
70
// DSCOPE versions can have name generated at runtime
73
- #define TRACE_CPU_DSCOPE ( section ) ZoneTransientN( __tracy_scoped_zone, section, g_tracingEnabled )
71
+ #define TRACE_CPU_DSCOPE ( section ) ZoneTransientN( __tracy_scoped_zone, section, g_tracingEnabled );
74
72
#define TRACE_CPU_DSCOPE_TEXT ( section, text_cstr ) \
75
- TRACE_CPU_DSCOPE ( section ) \
76
- TRACE_ATTACH_TEXT( text_cstr )
73
+ TRACE_CPU_DSCOPE ( section ); \
74
+ TRACE_ATTACH_TEXT ( text_cstr );
77
75
78
76
79
77
class GlDebugGroupScope {
@@ -89,5 +87,5 @@ class GlDebugGroupScope {
89
87
}
90
88
};
91
89
92
- #define TRACE_GL_SCOPE ( section ) GlDebugGroupScope __glDebugGroupCurentScope (section); TracyGpuNamedZone( __tracy_gpu_zone, section, g_tracingEnabled && g_glTraceInitialized );
93
- #define TRACE_GL_SCOPE_COLOR ( section, color ) GlDebugGroupScope __glDebugGroupCurentScope (section); TracyGpuNamedZoneC( __tracy_gpu_zone, section, color, g_tracingEnabled && g_glTraceInitialized );
90
+ #define TRACE_GL_SCOPE ( section ) GlDebugGroupScope __glDebugGroupCurrentScope (section); TracyGpuNamedZone( __tracy_gpu_zone, section, g_tracingEnabled && g_glTraceInitialized );
91
+ #define TRACE_GL_SCOPE_COLOR ( section, color ) GlDebugGroupScope __glDebugGroupCurrentScope (section); TracyGpuNamedZoneC( __tracy_gpu_zone, section, color, g_tracingEnabled && g_glTraceInitialized );
0 commit comments