14 #ifndef __UT_Tracing_h__
15 #define __UT_Tracing_h__
28 #define TRACY_ON_DEMAND
30 #define TRACY_DELAYED_INIT
31 #define TRACY_MANUAL_LIFETIME
34 #if !defined(MAKING_STATIC)
42 #include <tracy/tracy/Tracy.hpp>
44 class UT_API ut_TraceControl
69 static ut_TraceControl &
get();
71 bool flag(Flag
f)
const
73 return myFlags & (1u <<
f);
76 uint32_t setFlag(uint32_t idx, uint32_t
val)
78 uint32_t bflag = (1u << idx);
79 myFlags = val ? (myFlags | bflag) : (myFlags & ~bflag);
92 #define utTraceFlag(F) ut_TraceControl::get().flag(ut_TraceControl::F)
101 #define utZoneScopedFlag(F) ZoneNamed( ___tracy_scoped_zone, utTraceFlag(F) )
102 #define utZoneScopedFlagN(F, name) ZoneNamedN( ___tracy_scoped_zone, name, utTraceFlag(F) )
103 #define utZoneScopedFlagS(F, depth) ZoneNamedS( ___tracy_scoped_zone, depth, utTraceFlag(F) )
104 #define utZoneScopedFlagNS(F, name, depth) ZoneNamedNS( ___tracy_scoped_zone, name, depth, utTraceFlag(F) )
105 #define utZoneScopedBool(b) ZoneNamed( ___tracy_scoped_zone, b )
108 #define utZoneScoped utZoneScopedFlag(GENERIC)
109 #define utZoneScopedN(name) utZoneScopedFlagN(GENERIC, name)
113 #define utZoneScopedS(depth) utZoneScopedFlagS(GENERIC, depth)
114 #define utZoneScopedNS(name,depth) utZoneScopedFlagNS(GENERIC, name,depth)
121 #define utZoneText(txt,size) ZoneText(txt,size)
122 #define utZoneTextSH(sh) ZoneText((sh).c_str(),(sh).length())
123 #define utZoneName(name,size) ZoneName(name,size)
124 #define utZoneNameSH(sh) ZoneName((sh).c_str(),(sh).length())
125 #define utZoneColor(color) ZoneColor(color)
126 #define utZoneValue(value) ZoneValue(value)
127 #define utZoneIsActive ZoneIsActive
130 #define utFrameMark FrameMark
131 #define utFrameMarkNamed(x) FrameMarkNamed(x)
133 #define utTracePlot(name,val) TracyPlot(name,val)
135 #define utTracePlotConfigNum(name) TracyPlotConfig(name,tracy::PlotFormatType::Number)
136 #define utTracePlotConfigMem(name) TracyPlotConfig(name,tracy::PlotFormatType::Memory)
137 #define utTracePlotConfigPct(name) TracyPlotConfig(name,tracy::PlotFormatType::Percentage)
142 #define utTraceMessage(txt,size) TracyMessage(txt,size)
143 #define utTraceMessageSH(sh) TracyMessage((sh).c_str(),(sh).length())
144 #define utTraceMessageL(txt) TracyMessageL(txt)
145 #define utTraceMessageC(txt,size,color) TracyMessageC(txt,size,color)
146 #define utTraceMessageSHC(sh,color) TracyMessageC((sh).c_str(),(sh).length(),color)
147 #define utTraceMessageLC(txt,color) TracyMessageLC(txt,color)
149 #define utTraceMessageS(txt,size,depth) TracyMessageS(txt,size,depth)
150 #define utTraceMessageSHS(sh,depth) TracyMessageS((sh).c_str(),(sh).length(),depth)
151 #define utTraceMessageLS(txt,depth) TracyMessageLS(txt,depth)
152 #define utTraceMessageCS(txt,size,color,d) TracyMessageCS(txt,size,color,d)
153 #define utTraceMessageSHCS(sh,color,d) TracyMessageCS((sh).c_str(),(sh).length(),color,d)
154 #define utTraceMessageLCS(txt,color,depth) TracyMessageLCS(txt,color,depth)
156 #define utTraceMessageFlag(F,txt,size) if(utTraceFlag(F)) TracyMessage(txt,size)
157 #define utTraceMessageFlagSH(F,sh) if(utTraceFlag(F)) TracyMessage((sh).c_str(),(sh).length())
158 #define utTraceMessageFlagL(F,txt) if(utTraceFlag(F)) TracyMessageL(txt)
159 #define utTraceMessageFlagLC(F,txt,color) if(utTraceFlag(F)) TracyMessageLC(txt,color)
160 #define utTraceMessageFlagC(F,txt,size,color) if(utTraceFlag(F)) TracyMessageC(txt,size,color)
161 #define utTraceMessageFlagSHC(F,sh,color) if(utTraceFlag(F)) TracyMessageC((sh).c_str(),(sh).length(),color)
163 #define utTraceMessageFlagS(F,txt,size,depth) if(utTraceFlag(F)) TracyMessageS(txt,size,depth)
164 #define utTraceMessageFlagSHS(F,sh,depth) if(utTraceFlag(F)) TracyMessageS((sh).c_str(),(sh).length(),depth)
165 #define utTraceMessageFlagLS(F,txt,depth) if(utTraceFlag(F)) TracyMessageLS(txt,depth)
166 #define utTraceMessageFlagLCS(F,txt,color,depth) if(utTraceFlag(F)) TracyMessageLCS(txt,color,depth)
167 #define utTraceMessageFlagCS(F,txt,size,color,d) if(utTraceFlag(F)) TracyMessageCS(txt,size,color,d)
168 #define utTraceMessageFlagSHCS(F,sh,color,d) if(utTraceFlag(F)) TracyMessageCS((sh).c_str(),(sh).length(),color,d)
171 #define utTraceAlloc(ptr,size) TracyAlloc(ptr,size)
172 #define utTraceFree(ptr) TracyFree(ptr)
173 #define utTraceAllocN(ptr,size,name) TracyAllocN(ptr,size,name)
174 #define utTraceFreeN(ptr,name) TracyFreeN(ptr,name)
176 #define utTraceAllocS(ptr,size,depth) TracyAllocS(ptr, size, depth)
177 #define utTraceFreeS(ptr,depth) TracyFreeS(ptr, depth)
178 #define utTraceAllocNS(ptr,size,depth,name) TracyAllocNS(ptr, size, depth, name)
179 #define utTraceFreeNS(ptr,depth,name) TracyFreeNS(ptr, depth, name)
182 #define utTraceIsConnected TracyIsConnected
186 #define utZoneScopedNodeFlag(F, node) ZoneNamed( ___tracy_scoped_zone, utTraceFlag(F) ); \
187 if (node) utZoneNameSH(node->getName());
190 #define utZoneScopedNodeFlagP(F, node) utZoneScopedNodeFlag(F, node) \
191 if (utZoneIsActive && node && utTraceFlag(NODE_PATHS)) { \
192 UT_StringHolder ___zonetext = node->getFullPath(); \
193 utZoneTextSH(___zonetext);}
195 #define utTraceViewportDrawEvent(viewport, event) utZoneScopedFlag(VIEWPORT); \
196 if (utZoneIsActive) { \
197 utZoneNameSH(UT_StringHolder(viewport)); \
198 utZoneTextSH(UT_StringHolder(event)); }
203 #define utTraceFlag(F) false
205 #define utZoneScopedFlag(F)
206 #define utZoneScopedFlagN(F, name)
207 #define utZoneScopedFlagS(F, depth)
208 #define utZoneScopedFlagNS(F, name, depth)
209 #define utZoneScopedBool(b)
212 #define utZoneScopedN(name)
213 #define utZoneScopedC(color)
214 #define utZoneScopedNC(name,color)
216 #define utZoneScopedS(depth)
217 #define utZoneScopedNS(name,depth)
218 #define utZoneScopedCS(color,depth)
219 #define utZoneScopedNCS(name,color,depth)
221 #define utZoneText(txt,size)
222 #define utZoneTextSH(sh)
223 #define utZoneName(name,size)
224 #define utZoneNameSH(sh)
225 #define utZoneColor(color)
226 #define utZoneValue(value)
227 #define utZoneIsActive false
230 #define utFrameMarkNamed(x)
232 #define utTracePlot(name,val)
233 #define utTracePlotConfigNum(name)
234 #define utTracePlotConfigMem(name)
235 #define utTracePlotConfigPct(name)
237 #define utTraceMessage(txt,size)
238 #define utTraceMessageSH(sh)
239 #define utTraceMessageL(txt)
240 #define utTraceMessageC(txt,size,color)
241 #define utTraceMessageSHC(sh,color)
242 #define utTraceMessageLC(txt,color)
244 #define utTraceMessageS(txt,size,depth)
245 #define utTraceMessageSHS(sh,depth)
246 #define utTraceMessageLS(txt,depth)
247 #define utTraceMessageCS(txt,size,color,d)
248 #define utTraceMessageSHCS(sh,color,d)
249 #define utTraceMessageLCS(txt,color,depth)
251 #define utTraceMessageFlag(F,txt,size)
252 #define utTraceMessageFlagSH(F,sh)
253 #define utTraceMessageFlagL(F,txt)
254 #define utTraceMessageFlagLC(F,txt,color)
255 #define utTraceMessageFlagC(F,txt,size,color)
256 #define utTraceMessageFlagSHC(F,sh,color)
258 #define utTraceMessageFlagS(F,txt,size,depth)
259 #define utTraceMessageFlagSHS(F,sh,depth)
260 #define utTraceMessageFlagLS(F,txt,depth)
261 #define utTraceMessageFlagLCS(F,txt,color,depth)
262 #define utTraceMessageFlagCS(F,txt,size,color,d)
263 #define utTraceMessageFlagSHCS(F,sh,color,d)
265 #define utTraceAlloc(ptr,size)
266 #define utTraceFree(ptr)
267 #define utTraceAllocN(ptr,size,name)
268 #define utTraceFreeN(ptr,name)
270 #define utTraceAllocS(ptr,size,depth)
271 #define utTraceFreeS(ptr,depth)
272 #define utTraceAllocNS(ptr,size,depth,name)
273 #define utTraceFreeNS(ptr,depth,name)
275 #define utTraceIsConnected false
277 #define utZoneScopedNodeFlag(F, node)
278 #define utZoneScopedNodeFlagP(F, node)
280 #define utTraceViewportDrawEvent(viewport, event)
284 #endif // UT_ASSERT_H_INCLUDED
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
auto get(const UT_ARTIterator< T > &it) -> decltype(it.key())