1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
|
/**
* @file llprofiler_ategories.h
* @brief Profiling categories to minimize Tracy memory usage when viewing captures.
*
* $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2022, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LL_PROFILER_CATEGORIES_H
#define LL_PROFILER_CATEGORIES_H
// A Tracy capture can quickly consume memory. Use these defines to selectively turn on/off Tracy profiling for these categories.
// The biggest memory usage ones are:
//
// LL_PROFILER_CATEGORY_ENABLE_DRAWPOOL
// LL_PROFILER_CATEGORY_ENABLE_LLSD
// LL_PROFILER_CATEGORY_ENABLE_MEMORY
// LL_PROFILER_CATEGORY_ENABLE_SHADERS
//
// NOTE: You can still manually use:
// LL_PROFILE_ZONE_SCOPED();
// LL_PROFILE_ZONE_NAMED("name");
// but just be aware that those will ALWAYS show up in a Tracy capture
// a) using more memory, and
// b) adding visual clutter.
#define LL_PROFILER_CATEGORY_ENABLE_APP 1
#define LL_PROFILER_CATEGORY_ENABLE_AVATAR 1
#define LL_PROFILER_CATEGORY_ENABLE_DISPLAY 1
#define LL_PROFILER_CATEGORY_ENABLE_DRAWABLE 1
#define LL_PROFILER_CATEGORY_ENABLE_DRAWPOOL 1
#define LL_PROFILER_CATEGORY_ENABLE_ENVIRONMENT 1
#define LL_PROFILER_CATEGORY_ENABLE_FACE 1
#define LL_PROFILER_CATEGORY_ENABLE_LLSD 1
#define LL_PROFILER_CATEGORY_ENABLE_LOGGING 1
#define LL_PROFILER_CATEGORY_ENABLE_MATERIAL 1
#define LL_PROFILER_CATEGORY_ENABLE_MEDIA 1
#define LL_PROFILER_CATEGORY_ENABLE_MEMORY 1
#define LL_PROFILER_CATEGORY_ENABLE_NETWORK 1
#define LL_PROFILER_CATEGORY_ENABLE_OCTREE 1
#define LL_PROFILER_CATEGORY_ENABLE_PIPELINE 1
#define LL_PROFILER_CATEGORY_ENABLE_SHADER 1
#define LL_PROFILER_CATEGORY_ENABLE_SPATIAL 1
#define LL_PROFILER_CATEGORY_ENABLE_STATS 1
#define LL_PROFILER_CATEGORY_ENABLE_STRING 1
#define LL_PROFILER_CATEGORY_ENABLE_TEXTURE 1
#define LL_PROFILER_CATEGORY_ENABLE_THREAD 1
#define LL_PROFILER_CATEGORY_ENABLE_UI 1
#define LL_PROFILER_CATEGORY_ENABLE_VIEWER 1
#define LL_PROFILER_CATEGORY_ENABLE_VERTEX 1
#define LL_PROFILER_CATEGORY_ENABLE_VOLUME 1
#define LL_PROFILER_CATEGORY_ENABLE_WIN32 1
#if LL_PROFILER_CATEGORY_ENABLE_APP
#define LL_PROFILE_ZONE_NAMED_CATEGORY_APP LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_APP LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_APP(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_APP
#endif
#if LL_PROFILER_CATEGORY_ENABLE_AVATAR
#define LL_PROFILE_ZONE_NAMED_CATEGORY_AVATAR LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_AVATAR(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR
#endif
#if LL_PROFILER_CATEGORY_ENABLE_DISPLAY
#define LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY
#endif
#if LL_PROFILER_CATEGORY_ENABLE_DRAWABLE
#define LL_PROFILE_ZONE_NAMED_CATEGORY_DRAWABLE LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_DRAWABLE(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE
#endif
#if LL_PROFILER_CATEGORY_ENABLE_DRAWPOOL
#define LL_PROFILE_ZONE_NAMED_CATEGORY_DRAWPOOL LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_DRAWPOOL(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL
#endif
#if LL_PROFILER_CATEGORY_ENABLE_ENVIRONMENT
#define LL_PROFILE_ZONE_NAMED_CATEGORY_ENVIRONMENT LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_ENVIRONMENT LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_ENVIRONMENT(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_ENVIRONMENT
#endif
#if LL_PROFILER_CATEGORY_ENABLE_FACE
#define LL_PROFILE_ZONE_NAMED_CATEGORY_FACE LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_FACE(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE
#endif
#if LL_PROFILER_CATEGORY_ENABLE_LLSD
#define LL_PROFILE_ZONE_NAMED_CATEGORY_LLSD LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_LLSD(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD
#endif
#if LL_PROFILER_CATEGORY_ENABLE_LOGGING
#define LL_PROFILE_ZONE_NAMED_CATEGORY_LOGGING LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_LOGGING(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING
#endif
#if LL_PROFILER_CATEGORY_ENABLE_MATERIAL
#define LL_PROFILE_ZONE_NAMED_CATEGORY_MATERIAL LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_MATERIAL LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_MATERIAL(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_MATERIAL
#endif
#if LL_PROFILER_CATEGORY_ENABLE_MEDIA
#define LL_PROFILE_ZONE_NAMED_CATEGORY_MEDIA LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_MEDIA LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_MEDIA(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_MEDIA
#endif
#if LL_PROFILER_CATEGORY_ENABLE_MEMORY
#define LL_PROFILE_ZONE_NAMED_CATEGORY_MEMORY LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_MEMORY LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_MEMORY(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_MEMORY
#endif
#if LL_PROFILER_CATEGORY_ENABLE_NETWORK
#define LL_PROFILE_ZONE_NAMED_CATEGORY_NETWORK LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_NETWORK(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK
#endif
#if LL_PROFILER_CATEGORY_ENABLE_OCTREE
#define LL_PROFILE_ZONE_NAMED_CATEGORY_OCTREE LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_OCTREE LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_OCTREE(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_OCTREE
#endif
#if LL_PROFILER_CATEGORY_ENABLE_PIPELINE
#define LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE
#endif
#if LL_PROFILER_CATEGORY_ENABLE_SHADER
#define LL_PROFILE_ZONE_NAMED_CATEGORY_SHADER LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_SHADER LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_SHADER(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_SHADER
#endif
#if LL_PROFILER_CATEGORY_ENABLE_SPATIAL
#define LL_PROFILE_ZONE_NAMED_CATEGORY_SPATIAL LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_SPATIAL(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL
#endif
#if LL_PROFILER_CATEGORY_ENABLE_STATS
#define LL_PROFILE_ZONE_NAMED_CATEGORY_STATS LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_STATS LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_STATS(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_STATS
#endif
#if LL_PROFILER_CATEGORY_ENABLE_STRING
#define LL_PROFILE_ZONE_NAMED_CATEGORY_STRING LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_STRING LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_STRING(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_STRING
#endif
#if LL_PROFILER_CATEGORY_ENABLE_TEXTURE
#define LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE
#endif
#if LL_PROFILER_CATEGORY_ENABLE_THREAD
#define LL_PROFILE_ZONE_NAMED_CATEGORY_THREAD LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_THREAD(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
#endif
#if LL_PROFILER_CATEGORY_ENABLE_UI
#define LL_PROFILE_ZONE_NAMED_CATEGORY_UI LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_UI LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_UI(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_UI
#endif
#if LL_PROFILER_CATEGORY_ENABLE_VERTEX
#define LL_PROFILE_ZONE_NAMED_CATEGORY_VERTEX LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_VERTEX LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_VERTEX(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_VERTEX
#endif
#if LL_PROFILER_CATEGORY_ENABLE_VIEWER
#define LL_PROFILE_ZONE_NAMED_CATEGORY_VIEWER LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_VIEWER LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_VIEWER(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_VIEWER
#endif
#if LL_PROFILER_CATEGORY_ENABLE_VOLUME
#define LL_PROFILE_ZONE_NAMED_CATEGORY_VOLUME LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_VOLUME(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME
#endif
#if LL_PROFILER_CATEGORY_ENABLE_WIN32
#define LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32 LL_PROFILE_ZONE_NAMED
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_WIN32 LL_PROFILE_ZONE_SCOPED
#else
#define LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32(name)
#define LL_PROFILE_ZONE_SCOPED_CATEGORY_WIN32
#endif
#endif // LL_PROFILER_CATEGORIES_H
|