Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
folium-app
GitHub Repository: folium-app/Folium
Path: blob/a-new-beginning/SharedDependencies/Sources/microprofile/include/microprofile.h
2 views
1
#pragma once
2
// MIT License
3
//
4
// Copyright (c) 2023 Jonas Meyer
5
//
6
// Permission is hereby granted, free of charge, to any person obtaining a copy
7
// of this software and associated documentation files (the "Software"), to deal
8
// in the Software without restriction, including without limitation the rights
9
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
// copies of the Software, and to permit persons to whom the Software is
11
// furnished to do so, subject to the following conditions:
12
//
13
// The above copyright notice and this permission notice shall be included in all
14
// copies or substantial portions of the Software.
15
//
16
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
// SOFTWARE.
23
// ***********************************************************************
24
25
#ifndef MICROPROFILE_USE_CONFIG
26
#define MICROPROFILE_USE_CONFIG 0
27
#endif
28
29
#if MICROPROFILE_USE_CONFIG
30
#include "microprofile.config.h"
31
#endif
32
33
#ifndef MICROPROFILE_ENABLED
34
#define MICROPROFILE_ENABLED 1
35
#endif
36
37
#ifndef MICROPROFILE_DYNAMIC_INSTRUMENT
38
#if(defined(__APPLE__) && defined(__MACH__)) || (defined(_WIN32) && defined(_M_X64)) || (defined(__unix__) && defined(__x86_64__))
39
#ifdef MICROPROFILE_DYNAMIC_INSTRUMENT_ENABLE
40
#define MICROPROFILE_DYNAMIC_INSTRUMENT 1
41
#endif
42
#endif
43
#endif
44
45
#ifndef MICROPROFILE_DYNAMIC_INSTRUMENT
46
#define MICROPROFILE_DYNAMIC_INSTRUMENT 0
47
#endif
48
49
#ifndef MICROPROFILE_GPU_TIMERS_D3D11
50
#define MICROPROFILE_GPU_TIMERS_D3D11 0
51
#endif
52
53
#ifndef MICROPROFILE_GPU_TIMERS_GL
54
#define MICROPROFILE_GPU_TIMERS_GL 0
55
#endif
56
57
#ifndef MICROPROFILE_GPU_TIMERS_D3D12
58
#define MICROPROFILE_GPU_TIMERS_D3D12 0
59
#endif
60
61
#ifndef MICROPROFILE_BIG_ENDIAN
62
#define MICROPROFILE_BIG_ENDIAN 0
63
#endif
64
65
#ifndef MICROPROFILE_GPU_TIMERS_VULKAN
66
#define MICROPROFILE_GPU_TIMERS_VULKAN 0
67
#endif
68
69
#ifndef MICROPROFILE_LEGACY_CSV // set this if you rely on the legacy csv dump format. (single file with multiple csv sections)
70
#define MICROPROFILE_LEGACY_CSV 0
71
#endif
72
73
#ifndef MICROPROFILE_FRAME_EXTRA_DATA // Set this to always allocate frame extra data. This is useful if you're doing profiling on platform where there is plenty of memory.
74
#define MICROPROFILE_FRAME_EXTRA_DATA 0
75
#endif
76
77
#ifndef MICROPROFILE_IMGUI
78
#define MICROPROFILE_IMGUI 0
79
#endif
80
81
#ifndef MICROPROFILE_VERIFY_BALANCED
82
#define MICROPROFILE_VERIFY_BALANCED 0
83
#endif
84
85
#ifndef MICROPROFILE_ONCE
86
#define MICROPROFILE_ONCE
87
88
#include <stdint.h>
89
90
typedef uint64_t MicroProfileToken;
91
typedef uint16_t MicroProfileGroupId;
92
typedef uint32_t MicroProfileTimelineToken;
93
94
#if 0 == MICROPROFILE_ENABLED
95
96
#define MICROPROFILE_DECLARE(var)
97
#define MICROPROFILE_DEFINE(var, group, name, color)
98
#define MICROPROFILE_REGISTER_GROUP(group, color, category)
99
#define MICROPROFILE_DECLARE_GPU(var)
100
#define MICROPROFILE_DEFINE_GPU(var, name, color)
101
#define MICROPROFILE_SCOPE(var) \
102
do \
103
{ \
104
} while(0)
105
#define MICROPROFILE_SCOPEI(group, name, color) \
106
do \
107
{ \
108
} while(0)
109
#define MICROPROFILE_SCOPE_CSTR(cstr) \
110
do \
111
{ \
112
} while(0)
113
#define MICROPROFILE_SCOPE_TOKEN(token) \
114
do \
115
{ \
116
} while(0)
117
#define MICROPROFILE_SCOPEGPU_TOKEN(token)
118
#define MICROPROFILE_SCOPEGPU(var) \
119
do \
120
{ \
121
} while(0)
122
#define MICROPROFILE_SCOPEGPUI(name, color) \
123
do \
124
{ \
125
} while(0)
126
#define MICROPROFILE_SCOPEGPU_CSTR(cstr) \
127
do \
128
{ \
129
} while(0)
130
#define MICROPROFILE_SCOPEGPU_TOKEN_L(Log, token) \
131
do \
132
{ \
133
} while(0)
134
#define MICROPROFILE_SCOPEGPU_L(Log, var) \
135
do \
136
{ \
137
} while(0)
138
#define MICROPROFILE_SCOPEGPUI_L(Log, name, color) \
139
do \
140
{ \
141
} while(0)
142
#define MICROPROFILE_SCOPEGPU_CSTR_L(Log, cstr) \
143
do \
144
{ \
145
} while(0)
146
#define MICROPROFILE_SECTIONGPU_TOKEN(token) \
147
do \
148
{ \
149
} while(0)
150
#define MICROPROFILE_SECTIONGPU(var) \
151
do \
152
{ \
153
} while(0)
154
#define MICROPROFILE_SECTIONGPUI(name, color) \
155
do \
156
{ \
157
} while(0)
158
#define MICROPROFILE_SECTIONGPU_TOKEN_L(Log, token) \
159
do \
160
{ \
161
} while(0)
162
#define MICROPROFILE_SECTIONGPU_L(Log, var) \
163
do \
164
{ \
165
} while(0)
166
#define MICROPROFILE_SECTIONGPUI_L(Log, name, color) \
167
do \
168
{ \
169
} while(0)
170
171
#define MICROPROFILE_CONDITIONAL_SCOPEI(condition, group, name, color) \
172
do \
173
{ \
174
} while(0)
175
#define MICROPROFILE_ENTER(var) \
176
do \
177
{ \
178
} while(0)
179
#define MICROPROFILE_ENTER_TOKEN(var) \
180
do \
181
{ \
182
} while(0)
183
#define MICROPROFILE_ENTERI(group, name, color) \
184
do \
185
{ \
186
} while(0)
187
#define MICROPROFILE_LEAVE() \
188
do \
189
{ \
190
} while(0)
191
192
#define MICROPROFILE_GPU_ENTER(var) \
193
do \
194
{ \
195
} while(0)
196
#define MICROPROFILE_GPU_ENTER_TOKEN(token) \
197
do \
198
{ \
199
} while(0)
200
#define MICROPROFILE_GPU_ENTERI(group, name, color) \
201
do \
202
{ \
203
} while(0)
204
#define MICROPROFILE_GPU_LEAVE() \
205
do \
206
{ \
207
} while(0)
208
#define MICROPROFILE_GPU_ENTER_L(Log, var) \
209
do \
210
{ \
211
} while(0)
212
#define MICROPROFILE_GPU_ENTER_TOKEN_L(Log, token) \
213
do \
214
{ \
215
} while(0)
216
#define MICROPROFILE_GPU_ENTERI_L(Log, name, color) \
217
do \
218
{ \
219
} while(0)
220
#define MICROPROFILE_GPU_LEAVE_L(Log) \
221
do \
222
{ \
223
} while(0)
224
#define MICROPROFILE_GPU_INIT_QUEUE(QueueName) \
225
do \
226
{ \
227
} while(0)
228
#define MICROPROFILE_GPU_GET_QUEUE(QueueName) \
229
do \
230
{ \
231
} while(0)
232
#define MICROPROFILE_GPU_BEGIN(pContext, pLog) \
233
do \
234
{ \
235
} while(0)
236
#define MICROPROFILE_GPU_SET_CONTEXT(pContext, pLog) \
237
do \
238
{ \
239
} while(0)
240
#define MICROPROFILE_GPU_END(pLog) 0
241
#define MICROPROFILE_GPU_SUBMIT(Queue, Work) \
242
do \
243
{ \
244
} while(0)
245
246
#define MICROPROFILE_TIMELINE_TOKEN(token) \
247
do \
248
{ \
249
} while(0)
250
#define MICROPROFILE_TIMELINE_ENTER(token, color, name) \
251
do \
252
{ \
253
} while(0)
254
#define MICROPROFILE_TIMELINE_ENTERF(token, color, fmt, ...) \
255
do \
256
{ \
257
} while(0)
258
#define MICROPROFILE_TIMELINE_LEAVE(token) \
259
do \
260
{ \
261
} while(0)
262
#define MICROPROFILE_TIMELINE_ENTER_STATIC(color, name) \
263
do \
264
{ \
265
} while(0)
266
#define MICROPROFILE_TIMELINE_LEAVE_STATIC(name) \
267
do \
268
{ \
269
} while(0)
270
#define MICROPROFILE_TIMELINE_SCOPE(...) \
271
do \
272
{ \
273
} while(0)
274
#define MICROPROFILE_THREADLOGGPURESET(a) \
275
do \
276
{ \
277
} while(0)
278
#define MICROPROFILE_META_CPU(name, count)
279
#define MICROPROFILE_META_GPU(name, count)
280
#define MICROPROFILE_FORCEENABLECPUGROUP(s) \
281
do \
282
{ \
283
} while(0)
284
#define MICROPROFILE_FORCEDISABLECPUGROUP(s) \
285
do \
286
{ \
287
} while(0)
288
#define MICROPROFILE_FORCEENABLEGPUGROUP(s) \
289
do \
290
{ \
291
} while(0)
292
#define MICROPROFILE_FORCEDISABLEGPUGROUP(s) \
293
do \
294
{ \
295
} while(0)
296
#define MICROPROFILE_COUNTER_ADD(name, count) \
297
do \
298
{ \
299
} while(0)
300
#define MICROPROFILE_COUNTER_SUB(name, count) \
301
do \
302
{ \
303
} while(0)
304
#define MICROPROFILE_COUNTER_SET(name, count) \
305
do \
306
{ \
307
} while(0)
308
#define MICROPROFILE_COUNTER_SET_DOUBLE(name, count) \
309
do \
310
{ \
311
} while(0)
312
#define MICROPROFILE_COUNTER_SET_INT32_PTR(name, ptr) \
313
do \
314
{ \
315
} while(0)
316
#define MICROPROFILE_COUNTER_SET_INT64_PTR(name, ptr) \
317
do \
318
{ \
319
} while(0)
320
#define MICROPROFILE_COUNTER_CLEAR_PTR(name) \
321
do \
322
{ \
323
} while(0)
324
#define MICROPROFILE_COUNTER_SET_LIMIT(name, count) \
325
do \
326
{ \
327
} while(0)
328
#define MICROPROFILE_CONDITIONAL(expr)
329
#define MICROPROFILE_COUNTER_CONFIG(name, type, limit, flags)
330
#define MICROPROFILE_COUNTER_CONFIG_ONCE(name, type, limit, flags)
331
#define MICROPROFILE_DECLARE_LOCAL_COUNTER(var)
332
#define MICROPROFILE_DEFINE_LOCAL_COUNTER(var, name)
333
#define MICROPROFILE_DECLARE_LOCAL_ATOMIC_COUNTER(var)
334
#define MICROPROFILE_DEFINE_LOCAL_ATOMIC_COUNTER(var, name)
335
#define MICROPROFILE_COUNTER_LOCAL_ADD(var, count) \
336
do \
337
{ \
338
} while(0)
339
#define MICROPROFILE_COUNTER_LOCAL_SUB(var, count) \
340
do \
341
{ \
342
} while(0)
343
#define MICROPROFILE_COUNTER_LOCAL_SET(var, count) \
344
do \
345
{ \
346
} while(0)
347
#define MICROPROFILE_COUNTER_LOCAL_UPDATE_ADD(var) \
348
do \
349
{ \
350
} while(0)
351
#define MICROPROFILE_COUNTER_LOCAL_UPDATE_SET(var) \
352
do \
353
{ \
354
} while(0)
355
#define MICROPROFILE_COUNTER_LOCAL_ADD_ATOMIC(var, count) \
356
do \
357
{ \
358
} while(0)
359
#define MICROPROFILE_COUNTER_LOCAL_SUB_ATOMIC(var, count) \
360
do \
361
{ \
362
} while(0)
363
#define MICROPROFILE_COUNTER_LOCAL_SET_ATOMIC(var, count) \
364
do \
365
{ \
366
} while(0)
367
#define MICROPROFILE_COUNTER_LOCAL_UPDATE_ADD_ATOMIC(var) \
368
do \
369
{ \
370
} while(0)
371
#define MICROPROFILE_COUNTER_LOCAL_UPDATE_SET_ATOMIC(var) \
372
do \
373
{ \
374
} while(0)
375
376
#define MICROPROFILE_COUNTER_GET_TOKEN(name, f) 0
377
#define MICROPROFILE_COUNTER_TOKEN_ADD(v, count) do{}while(0)
378
#define MICROPROFILE_COUNTER_TOKEN_SUB(v, count) do{}while(0)
379
#define MICROPROFILE_COUNTER_TOKEN_SET(v, count) do{}while(0)
380
381
382
#define MicroProfileStartAutoFlip(nHz) \
383
do \
384
{ \
385
} while(0)
386
#define MicroProfileStopAutoFlip() \
387
do \
388
{ \
389
} while(0)
390
#define MicroProfileEnableFrameExtraCounterData() \
391
do \
392
{ \
393
} while(0)
394
#define MicroProfileGetTime(group, name) 0.f
395
#define MicroProfileOnThreadCreate(foo) \
396
do \
397
{ \
398
} while(0)
399
#define MicroProfileOnThreadExit() \
400
do \
401
{ \
402
} while(0)
403
#define MicroProfileFlip(...) \
404
do \
405
{ \
406
} while(0)
407
#define MicroProfileFlip_CB(pContext, FreezeCB, Flag) \
408
do \
409
{ \
410
} while(0)
411
#define MicroProfileSetAggregateFrames(a) \
412
do \
413
{ \
414
} while(0)
415
#define MicroProfileGetAggregateFrames() 0
416
#define MicroProfileGetCurrentAggregateFrames() 0
417
#define MicroProfileTogglePause() \
418
do \
419
{ \
420
} while(0)
421
#define MicroProfileToggleAllGroups() \
422
do \
423
{ \
424
} while(0)
425
#define MicroProfileDumpTimers() \
426
do \
427
{ \
428
} while(0)
429
#define MicroProfileShutdown() \
430
do \
431
{ \
432
} while(0)
433
#define MicroProfileSetForceEnable(a) \
434
do \
435
{ \
436
} while(0)
437
#define MicroProfileGetForceEnable() false
438
#define MicroProfileSetEnableAllGroups(b) \
439
do \
440
{ \
441
} while(0)
442
#define MicroProfileEnableCategory(a) \
443
do \
444
{ \
445
} while(0)
446
#define MicroProfileDisableCategory(a) \
447
do \
448
{ \
449
} while(0)
450
#define MicroProfileGetEnableAllGroups() false
451
#define MicroProfileSetForceMetaCounters(a)
452
#define MicroProfileGetForceMetaCounters() 0
453
#define MicroProfileEnableMetaCounter(c) \
454
do \
455
{ \
456
} while(0)
457
#define MicroProfileDisableMetaCounter(c) \
458
do \
459
{ \
460
} while(0)
461
#define MicroProfileDumpFile(...) \
462
do \
463
{ \
464
} while(0)
465
#define MicroProfileDumpFileImmediately(...) \
466
do \
467
{ \
468
} while(0)
469
#define MicroProfileStartContextSwitchTrace() \
470
do \
471
{ \
472
} while(0)
473
#define MicroProfileGpuInsertTimeStamp(a) 1
474
#define MicroProfileGpuGetTimeStamp(a) 0
475
#define MicroProfileTicksPerSecondGpu() 1
476
#define MicroProfileGetGpuTickReference(a, b) 0
477
#define MicroProfileGpuInitD3D12(pDevice, nNodeCount, pCommandQueue, pCopyQueue) \
478
do \
479
{ \
480
} while(0)
481
#define MicroProfileGpuInitD3D11(pDevice, pDeviceContext) \
482
do \
483
{ \
484
} while(0)
485
#define MicroProfileGpuShutdown() \
486
do \
487
{ \
488
} while(0)
489
#define MicroProfileGpuShutdownPlatform() \
490
do \
491
{ \
492
} while(0)
493
#define MicroProfileGpuInitGL() \
494
do \
495
{ \
496
} while(0)
497
#define MicroProfileSetCurrentNodeD3D12(nNode) \
498
do \
499
{ \
500
} while(0)
501
#define MicroProfilePlatformMarkersGetEnabled() 0
502
#define MicroProfilePlatformMarkersSetEnabled(bEnabled) \
503
do \
504
{ \
505
} while(0)
506
#define MicroProfileTickToMsMultiplierCpu() 1.f
507
#define MicroProfileTickToMsMultiplierGpu() 0.f
508
#define MicroProfileTicksPerSecondCpu() 1
509
#define MicroProfileTick() 0
510
#define MicroProfileEnabled() 0
511
512
#define MicroProfileCounterString nullptr
513
#define MicroProfileCounterTokenTree 0
514
#define MicroProfileCounterTokenTreeDynamic 0
515
516
#define MicroProfileCsvConfigEnd()
517
#define MicroProfileCsvConfigBegin(...)
518
#define MicroProfileCsvConfigAddTimer(...)
519
#define MicroProfileCsvConfigAddGroup(...)
520
#define MicroProfileCsvConfigAddCounter(...)
521
#define MicroProfileUpdateSettingsPath(...)
522
523
#define MicroProfileImguiGraphs(...) \
524
do \
525
{ \
526
} while(0)
527
#define MicroProfileImguiTable(...) \
528
do \
529
{ \
530
} while(0)
531
#define MicroProfileImguiControls(...) \
532
do \
533
{ \
534
} while(0)
535
536
#else
537
538
#include <stdint.h>
539
540
#ifdef MICROPROFILE_EXPORT
541
#include "microprofile.export.h"
542
#else
543
#ifndef MICROPROFILE_API
544
#define MICROPROFILE_API
545
#endif
546
#endif
547
548
#ifdef MICROPROFILE_PS4
549
#include "microprofile_ps4.h"
550
#endif
551
#ifdef MICROPROFILE_XBOXONE
552
#include "microprofile_xboxone.h"
553
#endif
554
555
#ifdef _WIN32
556
typedef uint32_t MicroProfileThreadIdType;
557
#else
558
#ifdef MICROPROFILE_THREADID_SIZE_4BYTE
559
typedef uint32_t MicroProfileThreadIdType;
560
#elif MICROPROFILE_THREADID_SIZE_8BYTE
561
typedef uint64_t MicroProfileThreadIdType;
562
#else
563
typedef uint64_t MicroProfileThreadIdType;
564
#endif
565
#endif
566
567
typedef void (*MicroProfileOnFreeze)(int nFrozen);
568
569
#define MICROPROFILE_TOKEN_PASTE0(a, b) a##b
570
#define MICROPROFILE_TOKEN_PASTE(a, b) MICROPROFILE_TOKEN_PASTE0(a, b)
571
572
#define MICROPROFILE_DECLARE(var) extern MicroProfileToken g_mp_##var
573
#define MICROPROFILE_DECLARE_GPU(var) extern MicroProfileToken g_mpGPU_##var
574
575
#define MICROPROFILE_DECLARE_SECTION(var) extern MicroProfileToken g_mp_##var
576
#define MICROPROFILE_DECLARE_SECTION_GPU(var) extern MicroProfileToken g_mpGPU_##var
577
578
#define MICROPROFILE_DEFINE(var, group, name, color) MicroProfileToken g_mp_##var = MicroProfileGetToken(group, name, color, MicroProfileTokenTypeCpu, 0)
579
#define MICROPROFILE_DEFINE_GPU(var, name, color) MicroProfileToken g_mpGPU_##var = MicroProfileGetToken("GPU", name, color, MicroProfileTokenTypeGpu, 0)
580
581
#define MICROPROFILE_DEFINE_SECTION(var, name, color) MicroProfileToken g_mp_##var = MicroProfileGetToken("__SECTION", name, color, MicroProfileTokenTypeCpu, MICROPROFILE_TIMER_FLAG_SECTION)
582
#define MICROPROFILE_DEFINE_SECTION_GPU(var, name, color) MicroProfileToken g_mpGPU_##var = MicroProfileGetToken("GPU", name, color, MicroProfileTokenTypeGpu, MICROPROFILE_TIMER_FLAG_SECTION)
583
584
#define MICROPROFILE_REGISTER_GROUP(group, category, color) MicroProfileRegisterGroup(group, category, color)
585
586
#define MICROPROFILE_SCOPE(var) MicroProfileScopeHandler MICROPROFILE_TOKEN_PASTE(foo, __LINE__)(g_mp_##var)
587
#define MICROPROFILE_SCOPE_TOKEN(token) MicroProfileScopeHandler MICROPROFILE_TOKEN_PASTE(foo, __LINE__)(token)
588
#define MICROPROFILE_SCOPEI(group, name, color) \
589
static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mp, __LINE__) = MicroProfileGetToken(group, name, color, MicroProfileTokenTypeCpu, 0); \
590
MicroProfileScopeHandler MICROPROFILE_TOKEN_PASTE(foo, __LINE__)(MICROPROFILE_TOKEN_PASTE(g_mp, __LINE__))
591
#define MICROPROFILE_SCOPE_CSTR(CStr) MicroProfileScopeHandlerCStr MICROPROFILE_TOKEN_PASTE(foo, __LINE__)(CStr)
592
593
#define MICROPROFILE_SECTION(var) MICROPROFILE_SCOPE(var)
594
#define MICROPROFILE_SECTIONI(name, color) \
595
static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mp, __LINE__) = MicroProfileGetToken("__SECTION", name, color, MicroProfileTokenTypeCpu, MICROPROFILE_TIMER_FLAG_SECTION); \
596
MicroProfileScopeHandler MICROPROFILE_TOKEN_PASTE(foo, __LINE__)(MICROPROFILE_TOKEN_PASTE(g_mp, __LINE__))
597
598
#define MICROPROFILE_SCOPEGPU_TOKEN(token) MicroProfileScopeGpuHandler MICROPROFILE_TOKEN_PASTE(fooGPU, __LINE__)(token, MicroProfileGetGlobalGpuThreadLog())
599
#define MICROPROFILE_SCOPEGPU(var) MicroProfileScopeGpuHandler MICROPROFILE_TOKEN_PASTE(fooGPU, __LINE__)(g_mpGPU_##var, MicroProfileGetGlobalGpuThreadLog())
600
#define MICROPROFILE_SCOPEGPUI(name, color) \
601
static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mpGPU, __LINE__) = MicroProfileGetToken("GPU", name, color, MicroProfileTokenTypeGpu, 0); \
602
MicroProfileScopeGpuHandler MICROPROFILE_TOKEN_PASTE(fooGPU, __LINE__)(MICROPROFILE_TOKEN_PASTE(g_mpGPU, __LINE__), MicroProfileGetGlobalGpuThreadLog())
603
#define MICROPROFILE_SCOPEGPU_CSTR(CStr) MicroProfileScopeGpuHandlerCStr MICROPROFILE_TOKEN_PASTE(foo, __LINE__)(CStr, MicroProfileGetGlobalGpuThreadLog())
604
605
#define MICROPROFILE_SCOPEGPU_TOKEN_L(Log, token) MicroProfileScopeGpuHandler MICROPROFILE_TOKEN_PASTE(fooGPU, __LINE__)(token, Log)
606
#define MICROPROFILE_SCOPEGPU_L(Log, var) MicroProfileScopeGpuHandler MICROPROFILE_TOKEN_PASTE(fooGPU, __LINE__)(g_mpGPU_##var, Log)
607
#define MICROPROFILE_SCOPEGPUI_L(Log, name, color) \
608
static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mpGPU, __LINE__) = MicroProfileGetToken("GPU", name, color, MicroProfileTokenTypeGpu, 0); \
609
MicroProfileScopeGpuHandler MICROPROFILE_TOKEN_PASTE(fooGPU, __LINE__)(MICROPROFILE_TOKEN_PASTE(g_mpGPU, __LINE__), Log)
610
#define MICROPROFILE_SCOPEGPU_CSTR_L(Log, CStr) MicroProfileScopeGpuHandler MICROPROFILE_TOKEN_PASTE(foo, __LINE__)(CStr, Log)
611
612
#define MICROPROFILE_SECTIONGPU_TOKEN(token) MICROPROFILE_SCOPEGPU_TOKEN(token)
613
#define MICROPROFILE_SECTIONGPU(var) MICROPROFILE_SCOPEGPU(var)
614
#define MICROPROFILE_SECTIONGPUI(name, color) \
615
static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mpGPU, __LINE__) = MicroProfileGetToken("__SECTIONGPU", name, color, MicroProfileTokenTypeGpu, MICROPROFILE_TIMER_FLAG_SECTION); \
616
MicroProfileScopeGpuHandler MICROPROFILE_TOKEN_PASTE(fooGPU, __LINE__)(MICROPROFILE_TOKEN_PASTE(g_mpGPU, __LINE__))
617
618
#define MICROPROFILE_SECTIONGPU_TOKEN_L(Log, token) MICROPROFILE_SCOPEGPU_TOKEN_L(token, Log)
619
#define MICROPROFILE_SECTIONGPU_L(Log, var) MICROPROFILE_SCOPEGPU_L(var, Log)
620
#define MICROPROFILE_SECTIONGPUI_L(Log, name, color) \
621
static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mpGPU, __LINE__) = MicroProfileGetToken("__SECTIONGPU", name, color, MicroProfileTokenTypeGpu, MICROPROFILE_TIMER_FLAG_SECTION); \
622
MicroProfileScopeGpuHandler MICROPROFILE_TOKEN_PASTE(fooGPU, __LINE__)(MICROPROFILE_TOKEN_PASTE(g_mpGPU, __LINE__), Log)
623
624
#define MICROPROFILE_CONDITIONAL_SCOPEI(condition, group, name, color) \
625
static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mp, __LINE__) = MicroProfileGetToken(group, name, color, MicroProfileTokenTypeCpu, 0); \
626
MicroProfileConditionalScopeHandler MICROPROFILE_TOKEN_PASTE(foo, __LINE__)(MICROPROFILE_TOKEN_PASTE(g_mp, __LINE__), condition)
627
#define MICROPROFILE_ENTER(var) MicroProfileEnter(g_mp_##var)
628
#define MICROPROFILE_ENTER_TOKEN(token) MicroProfileEnter(token)
629
#define MICROPROFILE_ENTERI(group, name, color) \
630
static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mp, __LINE__) = MICROPROFILE_INVALID_TOKEN; \
631
if(MICROPROFILE_INVALID_TOKEN == MICROPROFILE_TOKEN_PASTE(g_mp, __LINE__)) \
632
{ \
633
MicroProfileGetTokenC(&MICROPROFILE_TOKEN_PASTE(g_mp, __LINE__), group, name, color, MicroProfileTokenTypeCpu, 0); \
634
} \
635
MicroProfileEnter(MICROPROFILE_TOKEN_PASTE(g_mp, __LINE__))
636
#define MICROPROFILE_LEAVE() MicroProfileLeave()
637
638
#define MICROPROFILE_GPU_ENTER(var) MicroProfileEnterGpu(g_mpGPU_##var, MicroProfileGetGlobalGpuThreadLog())
639
#define MICROPROFILE_GPU_ENTER_TOKEN(token) MicroProfileEnterGpu(token, MicroProfileGetGlobalGpuThreadLog())
640
#define MICROPROFILE_GPU_ENTERI(group, name, color) \
641
static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mpGPU, __LINE__) = MICROPROFILE_INVALID_TOKEN; \
642
if(MICROPROFILE_INVALID_TOKEN == MICROPROFILE_TOKEN_PASTE(g_mpGPU, __LINE__)) \
643
{ \
644
MicroProfileGetTokenC(&MICROPROFILE_TOKEN_PASTE(g_mpGPU, __LINE__), group, name, color, MicroProfileTokenTypeGpu, 0); \
645
} \
646
MicroProfileEnterGpu(MICROPROFILE_TOKEN_PASTE(g_mpGPU, __LINE__), MicroProfileGetGlobalGpuThreadLog())
647
#define MICROPROFILE_GPU_LEAVE() MicroProfileLeaveGpu(MicroProfileGetGlobalGpuThreadLog())
648
#define MICROPROFILE_GPU_ENTER_L(Log, var) MicroProfileEnterGpu(g_mpGPU_##var, Log)
649
#define MICROPROFILE_GPU_ENTER_TOKEN_L(Log, token) MicroProfileEnterGpu(token, Log)
650
#define MICROPROFILE_GPU_ENTERI_L(Log, name, color) \
651
static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mpGPU, __LINE__) = MICROPROFILE_INVALID_TOKEN; \
652
if(MICROPROFILE_INVALID_TOKEN == MICROPROFILE_TOKEN_PASTE(g_mpGPU, __LINE__)) \
653
{ \
654
MicroProfileGetTokenC(&MICROPROFILE_TOKEN_PASTE(g_mpGPU, __LINE__), group, name, color, MicroProfileTokenTypeGpu, 0); \
655
} \
656
MicroProfileEnterGpu(MICROPROFILE_TOKEN_PASTE(g_mpGPU, __LINE__), Log)
657
#define MICROPROFILE_GPU_LEAVE_L(Log) MicroProfileLeaveGpu(Log)
658
#define MICROPROFILE_GPU_INIT_QUEUE(QueueName) MicroProfileInitGpuQueue(QueueName)
659
#define MICROPROFILE_GPU_FREE_QUEUE(QueueName) MicroProfileFreeGpuQueue(QueueName)
660
#define MICROPROFILE_GPU_GET_QUEUE(QueueName) MicroProfileGetGpuQueue(QueueName)
661
#define MICROPROFILE_GPU_BEGIN(pContext, pLog) MicroProfileGpuBegin(pContext, pLog)
662
#define MICROPROFILE_GPU_SET_CONTEXT(pContext, pLog) MicroProfileGpuSetContext(pContext, pLog)
663
#define MICROPROFILE_GPU_END(pLog) MicroProfileGpuEnd(pLog)
664
#define MICROPROFILE_GPU_SUBMIT(Queue, Work) MicroProfileGpuSubmit(Queue, Work)
665
#define MICROPROFILE_TIMELINE_TOKEN(token) MicroProfileTimelineToken token = 0
666
#define MICROPROFILE_TIMELINE_ENTER(token, color, name) token = MicroProfileTimelineEnter(color, name)
667
#define MICROPROFILE_TIMELINE_ENTERF(token, color, fmt, ...) token = MicroProfileTimelineEnterf(color, fmt, ##__VA_ARGS__)
668
#define MICROPROFILE_TIMELINE_LEAVE(token) \
669
do \
670
{ \
671
if(token) \
672
{ \
673
MicroProfileTimelineLeave(token); \
674
} \
675
} while(0)
676
// use only with static string literals
677
#define MICROPROFILE_TIMELINE_ENTER_STATIC(color, name) MicroProfileTimelineEnterStatic(color, name)
678
// use only with static string literals
679
#define MICROPROFILE_TIMELINE_LEAVE_STATIC(name) MicroProfileTimelineLeaveStatic(name)
680
#define MICROPROFILE_TIMELINE_SCOPE(color, fmt, ...) \
681
MicroProfileTimelineToken MICROPROFILE_TOKEN_PASTE(__timeline__, __LINE__) = MicroProfileTimelineEnterf(color, fmt, ##__VA_ARGS__); \
682
MicroProfileScopeTimelineExitHandler MICROPROFILE_TOKEN_PASTE(__timeline__0, __LINE__)(MICROPROFILE_TOKEN_PASTE(__timeline__, __LINE__))
683
684
#define MICROPROFILE_THREADLOGGPURESET(a) MicroProfileThreadLogGpuReset(a)
685
#define MICROPROFILE_META_CPU(name, count) \
686
do \
687
{ \
688
} while(0) // static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mp_meta,__LINE__) = MicroProfileGetMetaToken(name); MicroProfileMetaUpdate(MICROPROFILE_TOKEN_PASTE(g_mp_meta,__LINE__), count,
689
// MicroProfileTokenTypeCpu)
690
#define MICROPROFILE_COUNTER_ADD(name, count) \
691
static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mp_counter, __LINE__) = MicroProfileGetCounterToken(name, 0); \
692
MicroProfileCounterAdd(MICROPROFILE_TOKEN_PASTE(g_mp_counter, __LINE__), count)
693
#define MICROPROFILE_COUNTER_SUB(name, count) \
694
static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mp_counter, __LINE__) = MicroProfileGetCounterToken(name, 0); \
695
MicroProfileCounterAdd(MICROPROFILE_TOKEN_PASTE(g_mp_counter, __LINE__), -(int64_t)count)
696
#define MICROPROFILE_COUNTER_SET(name, count) \
697
static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mp_counter_set, __LINE__) = MicroProfileGetCounterToken(name, 0); \
698
MicroProfileCounterSet(MICROPROFILE_TOKEN_PASTE(g_mp_counter_set, __LINE__), count)
699
#define MICROPROFILE_COUNTER_SET_DOUBLE(name, count) \
700
static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mp_counter_set, __LINE__) = MicroProfileGetCounterToken(name, MICROPROFILE_COUNTER_FLAG_DOUBLE); \
701
MicroProfileCounterSetDouble(MICROPROFILE_TOKEN_PASTE(g_mp_counter_set, __LINE__), count)
702
#define MICROPROFILE_COUNTER_SET_INT32_PTR(name, ptr) MicroProfileCounterSetPtr(name, ptr, sizeof(int32_t))
703
#define MICROPROFILE_COUNTER_SET_INT64_PTR(name, ptr) MicroProfileCounterSetPtr(name, ptr, sizeof(int64_t))
704
#define MICROPROFILE_COUNTER_CLEAR_PTR(name) MicroProfileCounterSetPtr(name, 0, 0)
705
#define MICROPROFILE_COUNTER_SET_LIMIT(name, count) \
706
static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mp_counter, __LINE__) = MicroProfileGetCounterToken(name, 0); \
707
MicroProfileCounterSetLimit(MICROPROFILE_TOKEN_PASTE(g_mp_counter, __LINE__), count)
708
#define MICROPROFILE_COUNTER_CONFIG(name, type, limit, flags) MicroProfileCounterConfig(name, type, limit, flags)
709
#define MICROPROFILE_COUNTER_CONFIG_ONCE(name, type, limit, flags) \
710
do \
711
{ \
712
static bool MICROPROFILE_TOKEN_PASTE(g_mponce, __LINE__) = false; \
713
if(!MICROPROFILE_TOKEN_PASTE(g_mponce, __LINE__)) \
714
{ \
715
MICROPROFILE_TOKEN_PASTE(g_mponce, __LINE__) = true; \
716
MicroProfileCounterConfig(name, type, limit, flags); \
717
} \
718
} while(0)
719
#define MICROPROFILE_DECLARE_LOCAL_COUNTER(var) \
720
extern int64_t g_mp_local_counter##var; \
721
extern MicroProfileToken g_mp_counter_token##var;
722
#define MICROPROFILE_DEFINE_LOCAL_COUNTER(var, name) \
723
int64_t g_mp_local_counter##var = 0; \
724
MicroProfileToken g_mp_counter_token##var = MicroProfileGetCounterToken(name, 0)
725
#define MICROPROFILE_DECLARE_LOCAL_ATOMIC_COUNTER(var) extern MicroProfileToken g_mp_counter_token##var;
726
#define MICROPROFILE_DEFINE_LOCAL_ATOMIC_COUNTER(var, name) MicroProfileToken g_mp_counter_token##var = MicroProfileGetCounterToken(name, 0)
727
#define MICROPROFILE_COUNTER_LOCAL_ADD(var, count) MicroProfileLocalCounterAdd(&g_mp_local_counter##var, (count))
728
#define MICROPROFILE_COUNTER_LOCAL_SUB(var, count) MicroProfileLocalCounterAdd(&g_mp_local_counter##var, -(int64_t)(count))
729
#define MICROPROFILE_COUNTER_LOCAL_SET(var, count) MicroProfileLocalCounterSet(&g_mp_local_counter##var, count)
730
#define MICROPROFILE_COUNTER_LOCAL_UPDATE_ADD(var) MicroProfileCounterAdd(g_mp_counter_token##var, MicroProfileLocalCounterSet(&g_mp_local_counter##var, 0))
731
#define MICROPROFILE_COUNTER_LOCAL_UPDATE_SET(var) MicroProfileCounterSet(g_mp_counter_token##var, MicroProfileLocalCounterSet(&g_mp_local_counter##var, 0))
732
#define MICROPROFILE_COUNTER_LOCAL_ADD_ATOMIC(var, count) MicroProfileLocalCounterAddAtomic(g_mp_counter_token##var, (count))
733
#define MICROPROFILE_COUNTER_LOCAL_SUB_ATOMIC(var, count) MicroProfileLocalCounterAddAtomic(g_mp_counter_token##var, -(int64_t)(count))
734
#define MICROPROFILE_COUNTER_LOCAL_SET_ATOMIC(var, count) MicroProfileLocalCounterSetAtomic(g_mp_counter_token##var, count)
735
#define MICROPROFILE_COUNTER_LOCAL_UPDATE_ADD_ATOMIC(var) MicroProfileCounterAdd(g_mp_counter_token##var, MicroProfileLocalCounterSetAtomic(g_mp_counter_token##var, 0))
736
#define MICROPROFILE_COUNTER_LOCAL_UPDATE_SET_ATOMIC(var) MicroProfileCounterSet(g_mp_counter_token##var, MicroProfileLocalCounterSetAtomic(g_mp_counter_token##var, 0))
737
#define MICROPROFILE_COUNTER_GET_TOKEN(name, f) MicroProfileGetCounterToken(name, f)
738
#define MICROPROFILE_COUNTER_TOKEN_ADD(v, count) MicroProfileCounterAdd(v, count)
739
#define MICROPROFILE_COUNTER_TOKEN_SUB(v, count) MicroProfileCounterAdd(v, -(int64_t)count)
740
#define MICROPROFILE_COUNTER_TOKEN_SET(v, count) MicroProfileCounterSet(v, count)
741
#define MICROPROFILE_FORCEENABLECPUGROUP(s) MicroProfileForceEnableGroup(s, MicroProfileTokenTypeCpu)
742
#define MICROPROFILE_FORCEDISABLECPUGROUP(s) MicroProfileForceDisableGroup(s, MicroProfileTokenTypeCpu)
743
#define MICROPROFILE_FORCEENABLEGPUGROUP(s) MicroProfileForceEnableGroup(s, MicroProfileTokenTypeGpu)
744
#define MICROPROFILE_FORCEDISABLEGPUGROUP(s) MicroProfileForceDisableGroup(s, MicroProfileTokenTypeGpu)
745
#define MICROPROFILE_CONDITIONAL(expr) expr
746
747
#ifndef MICROPROFILE_PLATFORM_MARKERS
748
#define MICROPROFILE_PLATFORM_MARKERS 0
749
#endif
750
751
#if MICROPROFILE_PLATFORM_MARKERS
752
#define MICROPROFILE_PLATFORM_MARKERS_ENABLED S.nPlatformMarkersEnabled
753
#define MICROPROFILE_PLATFORM_MARKER_BEGIN(color, marker) MicroProfilePlatformMarkerBegin(color, marker)
754
#define MICROPROFILE_PLATFORM_MARKER_END() MicroProfilePlatformMarkerEnd()
755
#else
756
#define MICROPROFILE_PLATFORM_MARKER_BEGIN(color, marker) \
757
do \
758
{ \
759
(void)color; \
760
(void)marker; \
761
} while(0)
762
#define MICROPROFILE_PLATFORM_MARKER_END() \
763
do \
764
{ \
765
} while(0)
766
#define MICROPROFILE_PLATFORM_MARKERS_ENABLED 0
767
#endif
768
769
#define MICROPROFILE_MAJOR_VERSION 4
770
#define MICROPROFILE_MINOR_VERSION 0
771
772
#ifndef MICROPROFILE_USE_THREAD_NAME_CALLBACK
773
#define MICROPROFILE_USE_THREAD_NAME_CALLBACK 0
774
#endif
775
776
#ifndef MICROPROFILE_PER_THREAD_BUFFER_SIZE
777
#define MICROPROFILE_PER_THREAD_BUFFER_SIZE (2048 << 10)
778
#endif
779
780
#ifndef MICROPROFILE_PER_THREAD_GPU_BUFFER_SIZE
781
#define MICROPROFILE_PER_THREAD_GPU_BUFFER_SIZE (128 << 10)
782
#endif
783
784
#ifndef MICROPROFILE_MAX_FRAME_HISTORY
785
#define MICROPROFILE_MAX_FRAME_HISTORY 512
786
#endif
787
788
#ifndef MICROPROFILE_PRINTF
789
#define MICROPROFILE_PRINTF printf
790
#endif
791
792
// #ifndef MICROPROFILE_META_MAX
793
// #define MICROPROFILE_META_MAX 8
794
// #endif
795
796
#ifndef MICROPROFILE_WEBSERVER_PORT
797
#define MICROPROFILE_WEBSERVER_PORT 1338
798
#endif
799
800
#ifndef MICROPROFILE_WEBSERVER
801
#define MICROPROFILE_WEBSERVER 1
802
#endif
803
804
#ifndef MICROPROFILE_WEBSERVER_AUTO_START
805
#define MICROPROFILE_WEBSERVER_AUTO_START 1 // when set to 1, the webserver will start on first call to MicroProfileFlip
806
#endif
807
808
#ifndef MICROPROFILE_WEBSERVER_DEFAULT_FRAMES
809
#define MICROPROFILE_WEBSERVER_DEFAULT_FRAMES 30
810
#endif
811
812
#ifndef MICROPROFILE_WEBSERVER_SOCKET_BUFFER_SIZE
813
#define MICROPROFILE_WEBSERVER_SOCKET_BUFFER_SIZE (16 << 10)
814
#endif
815
816
#ifndef MICROPROFILE_GPU_TIMERS
817
#if defined(MICROPROFILE_GPU_TIMERS_VULKAN) || defined(MICROPROFILE_GPU_TIMERS_D3D12) || defined(MICROPROFILE_GPU_TIMERS_D3D11) || defined(MICROPROFILE_GPU_TIMERS_GL)
818
#define MICROPROFILE_GPU_TIMERS 1
819
#else
820
#define MICROPROFILE_GPU_TIMERS 0
821
#endif
822
#endif
823
824
#ifndef MICROPROFILE_GPU_FRAME_DELAY
825
#define MICROPROFILE_GPU_FRAME_DELAY 5 // must be > 0
826
#endif
827
828
#ifndef MICROPROFILE_NAME_MAX_LEN
829
#define MICROPROFILE_NAME_MAX_LEN 64
830
#endif
831
832
#ifndef MICROPROFILE_MAX_TIMERS
833
#define MICROPROFILE_MAX_TIMERS 1024
834
#endif
835
836
#ifndef MICROPROFILE_MAX_THREADS
837
#define MICROPROFILE_MAX_THREADS 128
838
#endif
839
840
#ifndef MICROPROFILE_UNPACK_RED
841
#define MICROPROFILE_UNPACK_RED(c) (0xff & ((c) >> 16))
842
#endif
843
844
#ifndef MICROPROFILE_UNPACK_GREEN
845
#define MICROPROFILE_UNPACK_GREEN(c) (0xff & ((c) >> 8))
846
#endif
847
848
#ifndef MICROPROFILE_UNPACK_BLUE
849
#define MICROPROFILE_UNPACK_BLUE(c) (0xff & ((c)))
850
#endif
851
852
#ifndef MICROPROFILE_DEFAULT_PRESET
853
#define MICROPROFILE_DEFAULT_PRESET "Default"
854
#endif
855
856
#ifndef MICROPROFILE_TIMELINE_MAX_ENTRIES
857
#define MICROPROFILE_TIMELINE_MAX_ENTRIES (4 << 10)
858
#endif
859
860
#ifndef MICROPROFILE_MAX_STRING
861
#define MICROPROFILE_MAX_STRING 128
862
#endif
863
864
#ifndef MICROPROFILE_TIMELINE_MAX_TOKENS
865
#define MICROPROFILE_TIMELINE_MAX_TOKENS 64
866
#endif
867
868
#ifndef MICROPROFILE_THREAD_LOG_FRAMES_REUSE
869
#define MICROPROFILE_THREAD_LOG_FRAMES_REUSE 200
870
#endif
871
872
#ifndef MICROPROFILE_CONTEXT_SWITCH_TRACE
873
#if defined(_WIN32)
874
#define MICROPROFILE_CONTEXT_SWITCH_TRACE 1
875
#elif defined(__APPLE__)
876
#define MICROPROFILE_CONTEXT_SWITCH_TRACE 0 // disabled until dtrace script is working.
877
#else
878
#define MICROPROFILE_CONTEXT_SWITCH_TRACE 0
879
#endif
880
#endif
881
882
#if MICROPROFILE_CONTEXT_SWITCH_TRACE
883
#define MICROPROFILE_CONTEXT_SWITCH_BUFFER_SIZE (128 * 1024) // 2mb with 16 byte entry size
884
#else
885
#define MICROPROFILE_CONTEXT_SWITCH_BUFFER_SIZE (1)
886
#endif
887
888
#ifndef MICROPROFILE_MINIZ
889
#define MICROPROFILE_MINIZ 0
890
#endif
891
892
#ifndef MICROPROFILE_COUNTER_HISTORY
893
#define MICROPROFILE_COUNTER_HISTORY 1
894
#endif
895
896
#ifndef MICROPROFILE_MAX_GROUPS
897
#define MICROPROFILE_MAX_GROUPS 128 // must be multiple of 32
898
#endif
899
900
#ifndef MICROPROFILE_STACK_MAX
901
#define MICROPROFILE_STACK_MAX 64
902
#endif
903
904
#ifndef MICROPROFILE_BREAK_ON_PATCH_FAIL
905
#define MICROPROFILE_BREAK_ON_PATCH_FAIL 0
906
#endif
907
908
#ifndef MICROPROFILE_INSTRUMENT_MICROPROFILE
909
#define MICROPROFILE_INSTRUMENT_MICROPROFILE 0
910
#endif
911
912
#ifndef MICROPROFILE_MAX_DYNAMIC_TOKENS
913
#define MICROPROFILE_MAX_DYNAMIC_TOKENS 2048
914
#endif
915
916
#ifndef MICROPROFILE_INSTRUMENT_SYMBOLNAME_MAXLEN
917
#define MICROPROFILE_INSTRUMENT_SYMBOLNAME_MAXLEN 128
918
#endif
919
920
#ifndef MICROPROFILE_INSTRUMENT_MAX_MODULES
921
#define MICROPROFILE_INSTRUMENT_MAX_MODULES 256
922
#endif
923
924
#ifndef MICROPROFILE_INSTRUMENT_MAX_MODULE_CHARS
925
#define MICROPROFILE_INSTRUMENT_MAX_MODULE_CHARS (8 << 10)
926
#endif
927
928
#ifndef MICROPROFILE_ASSERT_LOG_FREED
929
#define MICROPROFILE_ASSERT_LOG_FREED 0
930
#endif
931
932
#define MICROPROFILE_FLIP_FLAG_START_WEBSERVER 0x1
933
934
#if MICROPROFILE_WEBSERVER_AUTO_START
935
#define MICROPROFILE_FLIP_FLAG_DEFAULT (MICROPROFILE_FLIP_FLAG_START_WEBSERVER)
936
#else
937
#define MICROPROFILE_FLIP_FLAG_DEFAULT (0)
938
#endif
939
940
#ifndef MICROPROFILE_GET_SETTINGS_FILE_PATH
941
#define MICROPROFILE_GET_SETTINGS_FILE_PATH ""
942
#endif
943
944
#ifndef MICROPROFILE_MAX_CPU_CORES
945
#define MICROPROFILE_MAX_CPU_CORES 256
946
#endif
947
948
typedef enum MicroProfileTokenType_t
949
{
950
MicroProfileTokenTypeCpu,
951
MicroProfileTokenTypeGpu,
952
} MicroProfileTokenType;
953
954
struct MicroProfile;
955
struct MicroProfileThreadLogGpu;
956
struct MicroProfileScopeStateC;
957
958
#ifdef __cplusplus
959
#define IF_CPP(exp) exp
960
#else
961
#define IF_CPP(exp)
962
#endif
963
964
#ifdef __cplusplus
965
extern "C"
966
{
967
#endif
968
969
#define MICROPROFILE_INVALID_TOKEN ((uint64_t) - 1)
970
#define MICROPROFILE_TIMER_FLAG_SECTION 0x1
971
#define MICROPROFILE_TIMER_FLAG_PLACEHOLDER 0x1000
972
#define MICROPROFILE_CSV_FLAG_FRAME_NUMBERS 0x0
973
#define MICROPROFILE_CSV_FLAG_FRAME_TIME 0x1
974
975
MICROPROFILE_API void MicroProfileInit();
976
MICROPROFILE_API void MicroProfileShutdown();
977
MICROPROFILE_API void MicroProfileStartAutoFlip(uint32_t nHz);
978
MICROPROFILE_API void MicroProfileStopAutoFlip();
979
MICROPROFILE_API void MicroProfileEnableFrameExtraCounterData(); // enable per frame counter storage. uses more memory
980
MICROPROFILE_API MicroProfileToken MicroProfileFindToken(const char* sGroup, const char* sName);
981
MICROPROFILE_API MicroProfileToken MicroProfileGetToken(const char* sGroup, const char* sName, uint32_t nColor, MicroProfileTokenType Token, uint32_t flags);
982
MICROPROFILE_API void MicroProfileGetTokenC(MicroProfileToken* pToken, const char* sGroup, const char* sName, uint32_t nColor, MicroProfileTokenType Token, uint32_t flags);
983
MICROPROFILE_API MicroProfileToken MicroProfileGetCounterToken(const char* pName, uint32_t CounterTokenFlag);
984
MICROPROFILE_API MicroProfileToken MicroProfileGetChildCounterToken(MicroProfileToken Parent, const char* pName); // manually create the child/parent tree
985
MICROPROFILE_API void MicroProfileCounterAdd(MicroProfileToken nToken, int64_t nCount);
986
MICROPROFILE_API void MicroProfileCounterSet(MicroProfileToken nToken, int64_t nCount);
987
MICROPROFILE_API int64_t MicroProfileCounterGet(MicroProfileToken nToken);
988
MICROPROFILE_API void MicroProfileCounterSetDouble(MicroProfileToken nToken, double dCount);
989
MICROPROFILE_API double MicroProfileCounterGetDouble(MicroProfileToken nToken);
990
MICROPROFILE_API void MicroProfileCounterSetLimit(MicroProfileToken nToken, int64_t nCount);
991
MICROPROFILE_API void MicroProfileCounterSetLimitDouble(MicroProfileToken nToken, double nCount);
992
MICROPROFILE_API void MicroProfileCounterConfig(const char* pCounterName, uint32_t nFormat, int64_t nLimit, uint32_t nFlags);
993
MICROPROFILE_API void MicroProfileCounterConfigToken(MicroProfileToken nToken, uint32_t nFormat, int64_t nLimit, uint32_t nFlags);
994
MICROPROFILE_API void MicroProfileCounterSetPtr(const char* pCounterName, void* pValue, uint32_t nSize);
995
MICROPROFILE_API void MicroProfileCounterFetchCounters();
996
MICROPROFILE_API void MicroProfileLocalCounterAdd(int64_t* pCounter, int64_t nCount);
997
MICROPROFILE_API int64_t MicroProfileLocalCounterSet(int64_t* pCounter, int64_t nCount);
998
MICROPROFILE_API uint64_t MicroProfileEnterInternal(MicroProfileToken nToken);
999
MICROPROFILE_API void MicroProfileLeaveInternal(MicroProfileToken nToken, uint64_t nTick);
1000
MICROPROFILE_API uint64_t MicroProfileEnterInternalCStr(const char* pStr);
1001
1002
MICROPROFILE_API void MicroProfileLeaveInternalCStr(const char* pStr, uint64_t nTickStart);
1003
1004
MICROPROFILE_API void MicroProfileEnter(MicroProfileToken nToken);
1005
MICROPROFILE_API void MicroProfileLeave();
1006
1007
MICROPROFILE_API void MicroProfileEnterSection(const char* pName, uint32_t nColor);
1008
MICROPROFILE_API void MicroProfileLeaveSection();
1009
1010
MICROPROFILE_API void MicroProfileEnterGpu(MicroProfileToken nToken, struct MicroProfileThreadLogGpu* pLog);
1011
MICROPROFILE_API void MicroProfileLeaveGpu(struct MicroProfileThreadLogGpu* pLog);
1012
MICROPROFILE_API MicroProfileTimelineToken MicroProfileTimelineEnterInternal(uint32_t nColor, const char* pStr, uint32_t nStrLen, int bIsStaticString);
1013
MICROPROFILE_API MicroProfileTimelineToken MicroProfileTimelineEnter(uint32_t nColor, const char* pStr);
1014
MICROPROFILE_API MicroProfileTimelineToken MicroProfileTimelineEnterf(uint32_t nColor, const char* pStr, ...);
1015
MICROPROFILE_API void MicroProfileTimelineLeave(MicroProfileTimelineToken id);
1016
MICROPROFILE_API void MicroProfileTimelineEnterStatic(uint32_t nColor, const char* pStr);
1017
MICROPROFILE_API void MicroProfileTimelineLeaveStatic(const char* pStr);
1018
1019
MICROPROFILE_API uint64_t MicroProfileGpuEnterInternal(struct MicroProfileThreadLogGpu* pLog, MicroProfileToken nToken);
1020
MICROPROFILE_API void MicroProfileGpuLeaveInternal(struct MicroProfileThreadLogGpu* pLog, MicroProfileToken nToken, uint64_t nTick);
1021
MICROPROFILE_API uint64_t MicroProfileGpuEnterInternalCStr(struct MicroProfileThreadLogGpu* pGpuLog, const char* pStr);
1022
MICROPROFILE_API void MicroProfileGpuLeaveInternalCStr(struct MicroProfileThreadLogGpu* pGpuLog, uint64_t nTickStart);
1023
1024
MICROPROFILE_API void MicroProfileGpuBegin(void* pContext, struct MicroProfileThreadLogGpu* pLog);
1025
MICROPROFILE_API void MicroProfileGpuSetContext(void* pContext, struct MicroProfileThreadLogGpu* pLog);
1026
MICROPROFILE_API uint64_t MicroProfileGpuEnd(struct MicroProfileThreadLogGpu* pLog);
1027
MICROPROFILE_API struct MicroProfileThreadLogGpu* MicroProfileThreadLogGpuAlloc();
1028
MICROPROFILE_API void MicroProfileThreadLogGpuFree(struct MicroProfileThreadLogGpu* pLog);
1029
MICROPROFILE_API void MicroProfileThreadLogGpuReset(struct MicroProfileThreadLogGpu* pLog);
1030
MICROPROFILE_API void MicroProfileGpuSubmit(int nQueue, uint64_t nWork);
1031
MICROPROFILE_API int MicroProfileInitGpuQueue(const char* pQueueName);
1032
MICROPROFILE_API void MicroProfileFreeGpuQueue(int nQueue);
1033
MICROPROFILE_API int MicroProfileGetGpuQueue(const char* pQueueName);
1034
1035
MICROPROFILE_API void MicroProfileFlip(void* pGpuContext, uint32_t FlipFlag IF_CPP(= MICROPROFILE_FLIP_FLAG_DEFAULT)); //! call once per frame.
1036
MICROPROFILE_API void MicroProfileFlip_CB(void* pGpuContext, MicroProfileOnFreeze FreezeCB, uint32_t FlipFlag IF_CPP(= MICROPROFILE_FLIP_FLAG_DEFAULT)); //! call once per frame.
1037
MICROPROFILE_API void MicroProfileToggleFrozen();
1038
MICROPROFILE_API int MicroProfileIsFrozen();
1039
MICROPROFILE_API int MicroProfileEnabled();
1040
MICROPROFILE_API void MicroProfileForceEnableGroup(const char* pGroup, MicroProfileTokenType Type);
1041
MICROPROFILE_API void MicroProfileForceDisableGroup(const char* pGroup, MicroProfileTokenType Type);
1042
MICROPROFILE_API float MicroProfileGetTime(const char* pGroup, const char* pName);
1043
MICROPROFILE_API int MicroProfilePlatformMarkersGetEnabled(); // enable platform markers. disables microprofile markers
1044
MICROPROFILE_API void MicroProfilePlatformMarkersSetEnabled(int bEnabled); // enable platform markers. disables microprofile markers
1045
MICROPROFILE_API void MicroProfileContextSwitchSearch(uint32_t* pContextSwitchStart, uint32_t* pContextSwitchEnd, uint64_t nBaseTicksCpu, uint64_t nBaseTicksEndCpu);
1046
MICROPROFILE_API void MicroProfileOnThreadCreate(const char* pThreadName); // should be called from newly created threads
1047
MICROPROFILE_API void MicroProfileOnThreadExit(); // call on exit to reuse log
1048
MICROPROFILE_API void MicroProfileInitThreadLog();
1049
MICROPROFILE_API void MicroProfileSetEnableAllGroups(int bEnable);
1050
MICROPROFILE_API void MicroProfileEnableCategory(const char* pCategory);
1051
MICROPROFILE_API void MicroProfileDisableCategory(const char* pCategory);
1052
MICROPROFILE_API int MicroProfileGetEnableAllGroups();
1053
MICROPROFILE_API void MicroProfileSetForceMetaCounters(int bEnable);
1054
MICROPROFILE_API int MicroProfileGetForceMetaCounters();
1055
MICROPROFILE_API void MicroProfileEnableMetaCounter(const char* pMet);
1056
MICROPROFILE_API void MicroProfileDisableMetaCounter(const char* pMet);
1057
MICROPROFILE_API void MicroProfileSetAggregateFrames(int frames);
1058
MICROPROFILE_API int MicroProfileGetAggregateFrames();
1059
MICROPROFILE_API int MicroProfileGetCurrentAggregateFrames();
1060
MICROPROFILE_API struct MicroProfile* MicroProfileGet();
1061
MICROPROFILE_API void MicroProfileGetRange(uint32_t nPut, uint32_t nGet, uint32_t nRange[2][2]);
1062
MICROPROFILE_API void MicroProfileStartContextSwitchTrace();
1063
MICROPROFILE_API void MicroProfileStopContextSwitchTrace();
1064
MICROPROFILE_API int MicroProfileIsLocalThread(uint32_t nThreadId);
1065
MICROPROFILE_API int MicroProfileFormatCounter(int eFormat, int64_t nCounter, char* pOut, uint32_t nBufferSize);
1066
MICROPROFILE_API struct MicroProfileThreadLogGpu* MicroProfileGetGlobalGpuThreadLog();
1067
MICROPROFILE_API int MicroProfileGetGlobalGpuQueue();
1068
MICROPROFILE_API void MicroProfileRegisterGroup(const char* pGroup, const char* pCategory, uint32_t nColor);
1069
#if MICROPROFILE_PLATFORM_MARKERS
1070
MICROPROFILE_API void MicroProfilePlatformMarkerBegin(uint32_t nColor, const char* pMarker); // not implemented by microprofile.
1071
MICROPROFILE_API void MicroProfilePlatformMarkerEnd(); // not implemented by microprofile.
1072
#endif
1073
1074
MICROPROFILE_API float MicroProfileTickToMsMultiplierCpu();
1075
MICROPROFILE_API float MicroProfileTickToMsMultiplierGpu();
1076
MICROPROFILE_API int64_t MicroProfileTicksPerSecondCpu();
1077
MICROPROFILE_API uint64_t MicroProfileTick();
1078
1079
MICROPROFILE_API void MicroProfileLocalCounterAddAtomic(MicroProfileToken Token, int64_t nCount);
1080
MICROPROFILE_API int64_t MicroProfileLocalCounterSetAtomic(MicroProfileToken, int64_t nCount);
1081
1082
MICROPROFILE_API const char* MicroProfileCounterString(const char* String);
1083
MICROPROFILE_API MicroProfileToken MicroProfileCounterTokenTree(MicroProfileToken* LastToken, MicroProfileToken CurrentParent, const char* pString);
1084
MICROPROFILE_API MicroProfileToken MicroProfileCounterTokenTreeDynamic(MicroProfileToken* LastToken, MicroProfileToken Parent, const char* pString);
1085
1086
MICROPROFILE_API void MicroProfileCsvConfigEnd();
1087
MICROPROFILE_API void MicroProfileCsvConfigBegin(uint32_t MaxTimers, uint32_t MaxGroups, uint32_t MaxCounters, uint32_t Flags);
1088
MICROPROFILE_API void MicroProfileCsvConfigAddTimer(const char* Group, const char* Timer, const char* DisplayName IF_CPP(= nullptr), MicroProfileTokenType Type IF_CPP(= MicroProfileTokenTypeCpu));
1089
MICROPROFILE_API void MicroProfileCsvConfigAddGroup(const char* Group, const char* DisplayName IF_CPP(= nullptr));
1090
MICROPROFILE_API void MicroProfileCsvConfigAddCounter(const char* CounterName, const char* DisplayName IF_CPP(= nullptr));
1091
1092
MICROPROFILE_API void MicroProfileUpdateSettingsPath();
1093
1094
#if MICROPROFILE_IMGUI
1095
// Basic support for controlling MicroProfile from ImGui, and for rendering graphs & tables
1096
enum MicroProfileImguiAlign;
1097
struct MicroProfileImguiWindowDesc;
1098
struct MicroProfileImguiEntryDesc;
1099
MICROPROFILE_API void MicroProfileImguiGraphs(const MicroProfileImguiWindowDesc& Window, const MicroProfileImguiEntryDesc* Entries, uint32_t NumEntries);
1100
MICROPROFILE_API void MicroProfileImguiTable(const MicroProfileImguiWindowDesc& Window, const MicroProfileImguiEntryDesc* Entries, uint32_t NumEntries);
1101
MICROPROFILE_API void MicroProfileImguiControls();
1102
#endif
1103
1104
#ifdef __cplusplus
1105
}
1106
#endif
1107
1108
#ifdef __cplusplus
1109
struct MicroProfileThreadInfo
1110
{
1111
// 3 first members are used to sort. dont reorder
1112
uint32_t nIsLocal;
1113
MicroProfileThreadIdType pid;
1114
MicroProfileThreadIdType tid;
1115
// 3 first members are used to sort. dont reorder
1116
1117
const char* pThreadModule;
1118
const char* pProcessModule;
1119
MicroProfileThreadInfo()
1120
: nIsLocal(0)
1121
, pid(0)
1122
, tid(0)
1123
, pThreadModule("?")
1124
, pProcessModule("?")
1125
{
1126
}
1127
MicroProfileThreadInfo(uint32_t ThreadId, uint32_t ProcessId, uint32_t nIsLocal)
1128
: nIsLocal(nIsLocal)
1129
, pid(ProcessId)
1130
, tid(ThreadId)
1131
, pThreadModule("?")
1132
, pProcessModule("?")
1133
{
1134
}
1135
~MicroProfileThreadInfo()
1136
{
1137
}
1138
};
1139
MICROPROFILE_API MicroProfileThreadInfo MicroProfileGetThreadInfo(MicroProfileThreadIdType nThreadId);
1140
MICROPROFILE_API uint32_t MicroProfileGetThreadInfoArray(MicroProfileThreadInfo** pThreadArray);
1141
#endif
1142
1143
#ifdef __cplusplus
1144
extern "C"
1145
{
1146
#endif
1147
1148
#if MICROPROFILE_GPU_TIMERS_D3D12
1149
MICROPROFILE_API void MicroProfileGpuInitD3D12(void* pDevice, uint32_t nNodeCount, void** pCommandQueues, void** pCopyQueues);
1150
MICROPROFILE_API void MicroProfileGpuShutdownD3D12();
1151
MICROPROFILE_API void MicroProfileSetCurrentNodeD3D12(uint32_t nNode);
1152
#endif
1153
1154
#if MICROPROFILE_GPU_TIMERS_VULKAN
1155
#include <vulkan/vulkan.h>
1156
void MicroProfileGpuInitVulkan(VkDevice* pDevices, VkPhysicalDevice* pPhysicalDevices, VkQueue* pQueues, uint32_t* QueueFamily, uint32_t nNodeCount);
1157
MICROPROFILE_API void MicroProfileGpuShutdownVulkan();
1158
MICROPROFILE_API void MicroProfileSetCurrentNodeVulkan(uint32_t nNode);
1159
#endif
1160
1161
MICROPROFILE_API void MicroProfileDumpFile(const char* pHtml, const char* pCsv, float fCpuSpike, float fGpuSpike, uint32_t FrameCount IF_CPP(= MICROPROFILE_WEBSERVER_DEFAULT_FRAMES));
1162
MICROPROFILE_API void MicroProfileDumpFileImmediately(const char* pHtml, const char* pCsv, void* pGpuContext, uint32_t FrameCount IF_CPP(= MICROPROFILE_WEBSERVER_DEFAULT_FRAMES));
1163
1164
#if MICROPROFILE_ENABLED && MICROPROFILE_WEBSERVER
1165
MICROPROFILE_API uint32_t MicroProfileWebServerPort();
1166
MICROPROFILE_API void MicroProfileSetWebServerPort(uint32_t nPort);
1167
#else
1168
#define MicroProfileWebServerPort() ((uint32_t) - 1)
1169
#define MicroProfileSetWebServerPort(a) \
1170
do \
1171
{ \
1172
} while(0)
1173
#endif
1174
1175
typedef enum MicroProfileGpuTimerStateType_
1176
{
1177
MicroProfileGpuTimerStateType_Invalid = 0,
1178
MicroProfileGpuTimerStateType_D3D11,
1179
MicroProfileGpuTimerStateType_D3D12,
1180
MicroProfileGpuTimerStateType_Vulkan,
1181
MicroProfileGpuTimerStateType_GL,
1182
MicroProfileGpuTimerStateType_Custom
1183
} MicroProfileGpuTimerStateType;
1184
1185
typedef struct MicroProfileGpuTimerState_
1186
{
1187
MicroProfileGpuTimerStateType Type;
1188
} MicroProfileGpuTimerState;
1189
1190
#if MICROPROFILE_GPU_TIMERS
1191
typedef uint32_t(*MicroProfileGpuInsertTimeStamp_CB)(void* pContext);
1192
typedef uint64_t(*MicroProfileGpuGetTimeStamp_CB)(uint32_t nKey);
1193
typedef uint64_t(*MicroProfileTicksPerSecondGpu_CB)();
1194
typedef int (*MicroProfileGetGpuTickReference_CB)(int64_t* pOutCPU, int64_t* pOutGpu);
1195
typedef uint32_t(*MicroProfileGpuFlip_CB)(void*);
1196
typedef void (*MicroProfileGpuShutdown_CB)();
1197
1198
MICROPROFILE_API void MicroProfileGpuShutdownPlatform();
1199
1200
MICROPROFILE_API void MicroProfileGpuInitPlatform(MicroProfileGpuTimerStateType eType,
1201
MicroProfileGpuTimerState* pGpuState,
1202
MicroProfileGpuInsertTimeStamp_CB InsertTimeStamp,
1203
MicroProfileGpuGetTimeStamp_CB GetTimeStamp,
1204
MicroProfileTicksPerSecondGpu_CB TicksPerSecond,
1205
MicroProfileGetGpuTickReference_CB GetTickReference,
1206
MicroProfileGpuFlip_CB Flip,
1207
MicroProfileGpuShutdown_CB Shutdown);
1208
#else
1209
#define MicroProfileGpuShutdownPlatform() \
1210
do \
1211
{ \
1212
} while(0)
1213
#define MicroProfileGpuInitPlatform(...) \
1214
do \
1215
{ \
1216
} while(0)
1217
#define MicroProfileGpuInsertTimeStamp(a) 1
1218
#define MicroProfileGpuGetTimeStamp(a) 0
1219
#define MicroProfileTicksPerSecondGpu() 1
1220
#define MicroProfileGetGpuTickReference(a, b) 0
1221
#define MicroProfileGpuFlip(a) 0
1222
#define MicroProfileGpuShutdown() \
1223
do \
1224
{ \
1225
} while(0)
1226
1227
#endif
1228
1229
#if MICROPROFILE_GPU_TIMERS_D3D11
1230
#define MICROPROFILE_D3D11_MAX_QUERIES (32 << 10)
1231
MICROPROFILE_API void MicroProfileGpuInitD3D11(void* pDevice, void* pDeviceContext);
1232
MICROPROFILE_API void MicroProfileGpuShutdownD3D11();
1233
#endif
1234
1235
#if MICROPROFILE_GPU_TIMERS_GL
1236
#define MICROPROFILE_GL_MAX_QUERIES (8 << 10)
1237
MICROPROFILE_API void MicroProfileGpuInitGL();
1238
#endif
1239
1240
#if MICROPROFILE_USE_THREAD_NAME_CALLBACK
1241
MICROPROFILE_API const char* MicroProfileGetThreadName(char* pzName);
1242
#else
1243
#define MicroProfileGetThreadName(a) 0
1244
#endif
1245
1246
#ifdef __cplusplus
1247
}
1248
#endif
1249
1250
struct MicroProfileScopeStateC
1251
{
1252
MicroProfileToken Token;
1253
int64_t nTick;
1254
};
1255
1256
#ifdef __cplusplus
1257
struct MicroProfileScopeHandler
1258
{
1259
MicroProfileToken nToken;
1260
uint64_t nTick;
1261
MicroProfileScopeHandler(MicroProfileToken Token)
1262
: nToken(Token)
1263
{
1264
nTick = MicroProfileEnterInternal(nToken);
1265
}
1266
~MicroProfileScopeHandler()
1267
{
1268
MicroProfileLeaveInternal(nToken, nTick);
1269
}
1270
};
1271
1272
struct MicroProfileScopeHandlerCStr
1273
{
1274
uint64_t nTick;
1275
const char* pStr;
1276
MicroProfileScopeHandlerCStr(const char* pStr)
1277
: pStr(pStr)
1278
{
1279
nTick = MicroProfileEnterInternalCStr(pStr);
1280
}
1281
~MicroProfileScopeHandlerCStr()
1282
{
1283
MicroProfileLeaveInternalCStr(pStr, nTick);
1284
}
1285
};
1286
1287
struct MicroProfileScopeGpuHandler
1288
{
1289
MicroProfileToken nToken;
1290
MicroProfileThreadLogGpu* pLog;
1291
uint64_t nTick;
1292
MicroProfileScopeGpuHandler(MicroProfileToken Token, MicroProfileThreadLogGpu* pLog)
1293
: nToken(Token)
1294
, pLog(pLog)
1295
{
1296
nTick = MicroProfileGpuEnterInternal(pLog, nToken);
1297
}
1298
~MicroProfileScopeGpuHandler()
1299
{
1300
MicroProfileGpuLeaveInternal(pLog, nToken, nTick);
1301
}
1302
};
1303
1304
struct MicroProfileScopeGpuHandlerCStr
1305
{
1306
MicroProfileThreadLogGpu* pLog;
1307
uint64_t nTick;
1308
MicroProfileScopeGpuHandlerCStr(const char* pStr, MicroProfileThreadLogGpu* pLog)
1309
: pLog(pLog)
1310
{
1311
nTick = MicroProfileGpuEnterInternalCStr(pLog, pStr);
1312
}
1313
~MicroProfileScopeGpuHandlerCStr()
1314
{
1315
MicroProfileGpuLeaveInternalCStr(pLog, nTick);
1316
}
1317
};
1318
1319
struct MicroProfileConditionalScopeHandler
1320
{
1321
MicroProfileToken nToken;
1322
uint64_t nTick;
1323
MicroProfileConditionalScopeHandler(MicroProfileToken token, bool condition)
1324
: nToken(token)
1325
{
1326
nTick = condition ? MicroProfileEnterInternal(token) : MICROPROFILE_INVALID_TOKEN;
1327
}
1328
~MicroProfileConditionalScopeHandler()
1329
{
1330
if (nTick != MICROPROFILE_INVALID_TOKEN)
1331
{
1332
MicroProfileLeaveInternal(nToken, nTick);
1333
}
1334
}
1335
};
1336
struct MicroProfileScopeTimelineExitHandler
1337
{
1338
MicroProfileTimelineToken nToken;
1339
MicroProfileScopeTimelineExitHandler(MicroProfileTimelineToken Token)
1340
: nToken(Token)
1341
{
1342
}
1343
~MicroProfileScopeTimelineExitHandler()
1344
{
1345
MicroProfileTimelineLeave(nToken);
1346
}
1347
};
1348
1349
#if MICROPROFILE_IMGUI
1350
enum MicroProfileImguiAlign
1351
{
1352
MICROPROFILE_IMGUI_ALIGN_TOP_LEFT = 0,
1353
MICROPROFILE_IMGUI_ALIGN_TOP_RIGHT = 1,
1354
MICROPROFILE_IMGUI_ALIGN_BOTTOM_LEFT = 2,
1355
MICROPROFILE_IMGUI_ALIGN_BOTTOM_RIGHT = 3,
1356
};
1357
1358
struct MicroProfileImguiWindowDesc
1359
{
1360
uint32_t Align = MICROPROFILE_IMGUI_ALIGN_TOP_LEFT;
1361
int GraphWidth = 300;
1362
int GraphHeight = 80;
1363
int OffsetX = 0;
1364
int OffsetY = 0;
1365
};
1366
struct MicroProfileImguiEntryDesc
1367
{
1368
MicroProfileToken GraphTimer;
1369
float GraphMax = -1;
1370
};
1371
#endif
1372
1373
#endif //__cplusplus
1374
#endif // enabled
1375
1376
enum MicroProfileCounterFormat
1377
{
1378
MICROPROFILE_COUNTER_FORMAT_DEFAULT = 0,
1379
MICROPROFILE_COUNTER_FORMAT_BYTES = 1,
1380
};
1381
1382
enum MicroProfileCounterFlags
1383
{
1384
MICROPROFILE_COUNTER_FLAG_NONE = 0,
1385
MICROPROFILE_COUNTER_FLAG_DETAILED = 0x1,
1386
MICROPROFILE_COUNTER_FLAG_DETAILED_GRAPH = 0x2,
1387
// internal:
1388
MICROPROFILE_COUNTER_FLAG_INTERNAL_MASK = ~0x3,
1389
MICROPROFILE_COUNTER_FLAG_HAS_LIMIT = 0x4,
1390
MICROPROFILE_COUNTER_FLAG_CLOSED = 0x8,
1391
MICROPROFILE_COUNTER_FLAG_MANUAL_SWAP = 0x10,
1392
MICROPROFILE_COUNTER_FLAG_LEAF = 0x20,
1393
MICROPROFILE_COUNTER_FLAG_DOUBLE = 0x40,
1394
MICROPROFILE_COUNTER_FLAG_TYPE_MASK = MICROPROFILE_COUNTER_FLAG_DOUBLE,
1395
MICROPROFILE_COUNTER_FLAG_TOKEN_DONT_CREATE = 0x80000000,
1396
};
1397
1398
#endif // once
1399
1400
#define MP_AUTO 0
1401
// from http://fugal.net/vim/rgbtxt.html
1402
#define MP_SNOW 0xfffafa
1403
#define MP_GHOSTWHITE 0xf8f8ff
1404
#define MP_WHITESMOKE 0xf5f5f5
1405
#define MP_GAINSBORO 0xdcdcdc
1406
#define MP_FLORALWHITE 0xfffaf0
1407
#define MP_OLDLACE 0xfdf5e6
1408
#define MP_LINEN 0xfaf0e6
1409
#define MP_ANTIQUEWHITE 0xfaebd7
1410
#define MP_PAPAYAWHIP 0xffefd5
1411
#define MP_BLANCHEDALMOND 0xffebcd
1412
#define MP_BISQUE 0xffe4c4
1413
#define MP_PEACHPUFF 0xffdab9
1414
#define MP_NAVAJOWHITE 0xffdead
1415
#define MP_MOCCASIN 0xffe4b5
1416
#define MP_CORNSILK 0xfff8dc
1417
#define MP_IVORY 0xfffff0
1418
#define MP_LEMONCHIFFON 0xfffacd
1419
#define MP_SEASHELL 0xfff5ee
1420
#define MP_HONEYDEW 0xf0fff0
1421
#define MP_MINTCREAM 0xf5fffa
1422
#define MP_AZURE 0xf0ffff
1423
#define MP_ALICEBLUE 0xf0f8ff
1424
#define MP_LAVENDER 0xe6e6fa
1425
#define MP_LAVENDERBLUSH 0xfff0f5
1426
#define MP_MISTYROSE 0xffe4e1
1427
#define MP_WHITE 0xffffff
1428
#define MP_BLACK 0x010101
1429
#define MP_DARKSLATEGRAY 0x2f4f4f
1430
#define MP_DARKSLATEGREY 0x2f4f4f
1431
#define MP_DIMGRAY 0x696969
1432
#define MP_DIMGREY 0x696969
1433
#define MP_SLATEGRAY 0x708090
1434
#define MP_SLATEGREY 0x708090
1435
#define MP_LIGHTSLATEGRAY 0x778899
1436
#define MP_LIGHTSLATEGREY 0x778899
1437
#define MP_GRAY 0xbebebe
1438
#define MP_GREY 0xbebebe
1439
#define MP_LIGHTGREY 0xd3d3d3
1440
#define MP_LIGHTGRAY 0xd3d3d3
1441
#define MP_MIDNIGHTBLUE 0x191970
1442
#define MP_NAVY 0x000080
1443
#define MP_NAVYBLUE 0x000080
1444
#define MP_CORNFLOWERBLUE 0x6495ed
1445
#define MP_DARKSLATEBLUE 0x483d8b
1446
#define MP_SLATEBLUE 0x6a5acd
1447
#define MP_MEDIUMSLATEBLUE 0x7b68ee
1448
#define MP_LIGHTSLATEBLUE 0x8470ff
1449
#define MP_MEDIUMBLUE 0x0000cd
1450
#define MP_ROYALBLUE 0x4169e1
1451
#define MP_BLUE 0x0000ff
1452
#define MP_DODGERBLUE 0x1e90ff
1453
#define MP_DEEPSKYBLUE 0x00bfff
1454
#define MP_SKYBLUE 0x87ceeb
1455
#define MP_LIGHTSKYBLUE 0x87cefa
1456
#define MP_STEELBLUE 0x4682b4
1457
#define MP_LIGHTSTEELBLUE 0xb0c4de
1458
#define MP_LIGHTBLUE 0xadd8e6
1459
#define MP_POWDERBLUE 0xb0e0e6
1460
#define MP_PALETURQUOISE 0xafeeee
1461
#define MP_DARKTURQUOISE 0x00ced1
1462
#define MP_MEDIUMTURQUOISE 0x48d1cc
1463
#define MP_TURQUOISE 0x40e0d0
1464
#define MP_CYAN 0x00ffff
1465
#define MP_LIGHTCYAN 0xe0ffff
1466
#define MP_CADETBLUE 0x5f9ea0
1467
#define MP_MEDIUMAQUAMARINE 0x66cdaa
1468
#define MP_AQUAMARINE 0x7fffd4
1469
#define MP_DARKGREEN 0x006400
1470
#define MP_DARKOLIVEGREEN 0x556b2f
1471
#define MP_DARKSEAGREEN 0x8fbc8f
1472
#define MP_SEAGREEN 0x2e8b57
1473
#define MP_MEDIUMSEAGREEN 0x3cb371
1474
#define MP_LIGHTSEAGREEN 0x20b2aa
1475
#define MP_PALEGREEN 0x98fb98
1476
#define MP_SPRINGGREEN 0x00ff7f
1477
#define MP_LAWNGREEN 0x7cfc00
1478
#define MP_GREEN 0x00ff00
1479
#define MP_CHARTREUSE 0x7fff00
1480
#define MP_MEDIUMSPRINGGREEN 0x00fa9a
1481
#define MP_GREENYELLOW 0xadff2f
1482
#define MP_LIMEGREEN 0x32cd32
1483
#define MP_YELLOWGREEN 0x9acd32
1484
#define MP_FORESTGREEN 0x228b22
1485
#define MP_OLIVEDRAB 0x6b8e23
1486
#define MP_DARKKHAKI 0xbdb76b
1487
#define MP_KHAKI 0xf0e68c
1488
#define MP_PALEGOLDENROD 0xeee8aa
1489
#define MP_LIGHTGOLDENRODYELLOW 0xfafad2
1490
#define MP_LIGHTYELLOW 0xffffe0
1491
#define MP_YELLOW 0xffff00
1492
#define MP_GOLD 0xffd700
1493
#define MP_LIGHTGOLDENROD 0xeedd82
1494
#define MP_GOLDENROD 0xdaa520
1495
#define MP_DARKGOLDENROD 0xb8860b
1496
#define MP_ROSYBROWN 0xbc8f8f
1497
#define MP_INDIANRED 0xcd5c5c
1498
#define MP_SADDLEBROWN 0x8b4513
1499
#define MP_SIENNA 0xa0522d
1500
#define MP_PERU 0xcd853f
1501
#define MP_BURLYWOOD 0xdeb887
1502
#define MP_BEIGE 0xf5f5dc
1503
#define MP_WHEAT 0xf5deb3
1504
#define MP_SANDYBROWN 0xf4a460
1505
#define MP_TAN 0xd2b48c
1506
#define MP_CHOCOLATE 0xd2691e
1507
#define MP_FIREBRICK 0xb22222
1508
#define MP_BROWN 0xa52a2a
1509
#define MP_DARKSALMON 0xe9967a
1510
#define MP_SALMON 0xfa8072
1511
#define MP_LIGHTSALMON 0xffa07a
1512
#define MP_ORANGE 0xffa500
1513
#define MP_DARKORANGE 0xff8c00
1514
#define MP_CORAL 0xff7f50
1515
#define MP_LIGHTCORAL 0xf08080
1516
#define MP_TOMATO 0xff6347
1517
#define MP_ORANGERED 0xff4500
1518
#define MP_RED 0xff0000
1519
#define MP_HOTPINK 0xff69b4
1520
#define MP_DEEPPINK 0xff1493
1521
#define MP_PINK 0xffc0cb
1522
#define MP_LIGHTPINK 0xffb6c1
1523
#define MP_PALEVIOLETRED 0xdb7093
1524
#define MP_MAROON 0xb03060
1525
#define MP_MEDIUMVIOLETRED 0xc71585
1526
#define MP_VIOLETRED 0xd02090
1527
#define MP_MAGENTA 0xff00ff
1528
#define MP_VIOLET 0xee82ee
1529
#define MP_PLUM 0xdda0dd
1530
#define MP_ORCHID 0xda70d6
1531
#define MP_MEDIUMORCHID 0xba55d3
1532
#define MP_DARKORCHID 0x9932cc
1533
#define MP_DARKVIOLET 0x9400d3
1534
#define MP_BLUEVIOLET 0x8a2be2
1535
#define MP_PURPLE 0xa020f0
1536
#define MP_MEDIUMPURPLE 0x9370db
1537
#define MP_THISTLE 0xd8bfd8
1538
#define MP_SNOW1 0xfffafa
1539
#define MP_SNOW2 0xeee9e9
1540
#define MP_SNOW3 0xcdc9c9
1541
#define MP_SNOW4 0x8b8989
1542
#define MP_SEASHELL1 0xfff5ee
1543
#define MP_SEASHELL2 0xeee5de
1544
#define MP_SEASHELL3 0xcdc5bf
1545
#define MP_SEASHELL4 0x8b8682
1546
#define MP_ANTIQUEWHITE1 0xffefdb
1547
#define MP_ANTIQUEWHITE2 0xeedfcc
1548
#define MP_ANTIQUEWHITE3 0xcdc0b0
1549
#define MP_ANTIQUEWHITE4 0x8b8378
1550
#define MP_BISQUE1 0xffe4c4
1551
#define MP_BISQUE2 0xeed5b7
1552
#define MP_BISQUE3 0xcdb79e
1553
#define MP_BISQUE4 0x8b7d6b
1554
#define MP_PEACHPUFF1 0xffdab9
1555
#define MP_PEACHPUFF2 0xeecbad
1556
#define MP_PEACHPUFF3 0xcdaf95
1557
#define MP_PEACHPUFF4 0x8b7765
1558
#define MP_NAVAJOWHITE1 0xffdead
1559
#define MP_NAVAJOWHITE2 0xeecfa1
1560
#define MP_NAVAJOWHITE3 0xcdb38b
1561
#define MP_NAVAJOWHITE4 0x8b795e
1562
#define MP_LEMONCHIFFON1 0xfffacd
1563
#define MP_LEMONCHIFFON2 0xeee9bf
1564
#define MP_LEMONCHIFFON3 0xcdc9a5
1565
#define MP_LEMONCHIFFON4 0x8b8970
1566
#define MP_CORNSILK1 0xfff8dc
1567
#define MP_CORNSILK2 0xeee8cd
1568
#define MP_CORNSILK3 0xcdc8b1
1569
#define MP_CORNSILK4 0x8b8878
1570
#define MP_IVORY1 0xfffff0
1571
#define MP_IVORY2 0xeeeee0
1572
#define MP_IVORY3 0xcdcdc1
1573
#define MP_IVORY4 0x8b8b83
1574
#define MP_HONEYDEW1 0xf0fff0
1575
#define MP_HONEYDEW2 0xe0eee0
1576
#define MP_HONEYDEW3 0xc1cdc1
1577
#define MP_HONEYDEW4 0x838b83
1578
#define MP_LAVENDERBLUSH1 0xfff0f5
1579
#define MP_LAVENDERBLUSH2 0xeee0e5
1580
#define MP_LAVENDERBLUSH3 0xcdc1c5
1581
#define MP_LAVENDERBLUSH4 0x8b8386
1582
#define MP_MISTYROSE1 0xffe4e1
1583
#define MP_MISTYROSE2 0xeed5d2
1584
#define MP_MISTYROSE3 0xcdb7b5
1585
#define MP_MISTYROSE4 0x8b7d7b
1586
#define MP_AZURE1 0xf0ffff
1587
#define MP_AZURE2 0xe0eeee
1588
#define MP_AZURE3 0xc1cdcd
1589
#define MP_AZURE4 0x838b8b
1590
#define MP_SLATEBLUE1 0x836fff
1591
#define MP_SLATEBLUE2 0x7a67ee
1592
#define MP_SLATEBLUE3 0x6959cd
1593
#define MP_SLATEBLUE4 0x473c8b
1594
#define MP_ROYALBLUE1 0x4876ff
1595
#define MP_ROYALBLUE2 0x436eee
1596
#define MP_ROYALBLUE3 0x3a5fcd
1597
#define MP_ROYALBLUE4 0x27408b
1598
#define MP_BLUE1 0x0000ff
1599
#define MP_BLUE2 0x0000ee
1600
#define MP_BLUE3 0x0000cd
1601
#define MP_BLUE4 0x00008b
1602
#define MP_DODGERBLUE1 0x1e90ff
1603
#define MP_DODGERBLUE2 0x1c86ee
1604
#define MP_DODGERBLUE3 0x1874cd
1605
#define MP_DODGERBLUE4 0x104e8b
1606
#define MP_STEELBLUE1 0x63b8ff
1607
#define MP_STEELBLUE2 0x5cacee
1608
#define MP_STEELBLUE3 0x4f94cd
1609
#define MP_STEELBLUE4 0x36648b
1610
#define MP_DEEPSKYBLUE1 0x00bfff
1611
#define MP_DEEPSKYBLUE2 0x00b2ee
1612
#define MP_DEEPSKYBLUE3 0x009acd
1613
#define MP_DEEPSKYBLUE4 0x00688b
1614
#define MP_SKYBLUE1 0x87ceff
1615
#define MP_SKYBLUE2 0x7ec0ee
1616
#define MP_SKYBLUE3 0x6ca6cd
1617
#define MP_SKYBLUE4 0x4a708b
1618
#define MP_LIGHTSKYBLUE1 0xb0e2ff
1619
#define MP_LIGHTSKYBLUE2 0xa4d3ee
1620
#define MP_LIGHTSKYBLUE3 0x8db6cd
1621
#define MP_LIGHTSKYBLUE4 0x607b8b
1622
#define MP_SLATEGRAY1 0xc6e2ff
1623
#define MP_SLATEGRAY2 0xb9d3ee
1624
#define MP_SLATEGRAY3 0x9fb6cd
1625
#define MP_SLATEGRAY4 0x6c7b8b
1626
#define MP_LIGHTSTEELBLUE1 0xcae1ff
1627
#define MP_LIGHTSTEELBLUE2 0xbcd2ee
1628
#define MP_LIGHTSTEELBLUE3 0xa2b5cd
1629
#define MP_LIGHTSTEELBLUE4 0x6e7b8b
1630
#define MP_LIGHTBLUE1 0xbfefff
1631
#define MP_LIGHTBLUE2 0xb2dfee
1632
#define MP_LIGHTBLUE3 0x9ac0cd
1633
#define MP_LIGHTBLUE4 0x68838b
1634
#define MP_LIGHTCYAN1 0xe0ffff
1635
#define MP_LIGHTCYAN2 0xd1eeee
1636
#define MP_LIGHTCYAN3 0xb4cdcd
1637
#define MP_LIGHTCYAN4 0x7a8b8b
1638
#define MP_PALETURQUOISE1 0xbbffff
1639
#define MP_PALETURQUOISE2 0xaeeeee
1640
#define MP_PALETURQUOISE3 0x96cdcd
1641
#define MP_PALETURQUOISE4 0x668b8b
1642
#define MP_CADETBLUE1 0x98f5ff
1643
#define MP_CADETBLUE2 0x8ee5ee
1644
#define MP_CADETBLUE3 0x7ac5cd
1645
#define MP_CADETBLUE4 0x53868b
1646
#define MP_TURQUOISE1 0x00f5ff
1647
#define MP_TURQUOISE2 0x00e5ee
1648
#define MP_TURQUOISE3 0x00c5cd
1649
#define MP_TURQUOISE4 0x00868b
1650
#define MP_CYAN1 0x00ffff
1651
#define MP_CYAN2 0x00eeee
1652
#define MP_CYAN3 0x00cdcd
1653
#define MP_CYAN4 0x008b8b
1654
#define MP_DARKSLATEGRAY1 0x97ffff
1655
#define MP_DARKSLATEGRAY2 0x8deeee
1656
#define MP_DARKSLATEGRAY3 0x79cdcd
1657
#define MP_DARKSLATEGRAY4 0x528b8b
1658
#define MP_AQUAMARINE1 0x7fffd4
1659
#define MP_AQUAMARINE2 0x76eec6
1660
#define MP_AQUAMARINE3 0x66cdaa
1661
#define MP_AQUAMARINE4 0x458b74
1662
#define MP_DARKSEAGREEN1 0xc1ffc1
1663
#define MP_DARKSEAGREEN2 0xb4eeb4
1664
#define MP_DARKSEAGREEN3 0x9bcd9b
1665
#define MP_DARKSEAGREEN4 0x698b69
1666
#define MP_SEAGREEN1 0x54ff9f
1667
#define MP_SEAGREEN2 0x4eee94
1668
#define MP_SEAGREEN3 0x43cd80
1669
#define MP_SEAGREEN4 0x2e8b57
1670
#define MP_PALEGREEN1 0x9aff9a
1671
#define MP_PALEGREEN2 0x90ee90
1672
#define MP_PALEGREEN3 0x7ccd7c
1673
#define MP_PALEGREEN4 0x548b54
1674
#define MP_SPRINGGREEN1 0x00ff7f
1675
#define MP_SPRINGGREEN2 0x00ee76
1676
#define MP_SPRINGGREEN3 0x00cd66
1677
#define MP_SPRINGGREEN4 0x008b45
1678
#define MP_GREEN1 0x00ff00
1679
#define MP_GREEN2 0x00ee00
1680
#define MP_GREEN3 0x00cd00
1681
#define MP_GREEN4 0x008b00
1682
#define MP_CHARTREUSE1 0x7fff00
1683
#define MP_CHARTREUSE2 0x76ee00
1684
#define MP_CHARTREUSE3 0x66cd00
1685
#define MP_CHARTREUSE4 0x458b00
1686
#define MP_OLIVEDRAB1 0xc0ff3e
1687
#define MP_OLIVEDRAB2 0xb3ee3a
1688
#define MP_OLIVEDRAB3 0x9acd32
1689
#define MP_OLIVEDRAB4 0x698b22
1690
#define MP_DARKOLIVEGREEN1 0xcaff70
1691
#define MP_DARKOLIVEGREEN2 0xbcee68
1692
#define MP_DARKOLIVEGREEN3 0xa2cd5a
1693
#define MP_DARKOLIVEGREEN4 0x6e8b3d
1694
#define MP_KHAKI1 0xfff68f
1695
#define MP_KHAKI2 0xeee685
1696
#define MP_KHAKI3 0xcdc673
1697
#define MP_KHAKI4 0x8b864e
1698
#define MP_LIGHTGOLDENROD1 0xffec8b
1699
#define MP_LIGHTGOLDENROD2 0xeedc82
1700
#define MP_LIGHTGOLDENROD3 0xcdbe70
1701
#define MP_LIGHTGOLDENROD4 0x8b814c
1702
#define MP_LIGHTYELLOW1 0xffffe0
1703
#define MP_LIGHTYELLOW2 0xeeeed1
1704
#define MP_LIGHTYELLOW3 0xcdcdb4
1705
#define MP_LIGHTYELLOW4 0x8b8b7a
1706
#define MP_YELLOW1 0xffff00
1707
#define MP_YELLOW2 0xeeee00
1708
#define MP_YELLOW3 0xcdcd00
1709
#define MP_YELLOW4 0x8b8b00
1710
#define MP_GOLD1 0xffd700
1711
#define MP_GOLD2 0xeec900
1712
#define MP_GOLD3 0xcdad00
1713
#define MP_GOLD4 0x8b7500
1714
#define MP_GOLDENROD1 0xffc125
1715
#define MP_GOLDENROD2 0xeeb422
1716
#define MP_GOLDENROD3 0xcd9b1d
1717
#define MP_GOLDENROD4 0x8b6914
1718
#define MP_DARKGOLDENROD1 0xffb90f
1719
#define MP_DARKGOLDENROD2 0xeead0e
1720
#define MP_DARKGOLDENROD3 0xcd950c
1721
#define MP_DARKGOLDENROD4 0x8b6508
1722
#define MP_ROSYBROWN1 0xffc1c1
1723
#define MP_ROSYBROWN2 0xeeb4b4
1724
#define MP_ROSYBROWN3 0xcd9b9b
1725
#define MP_ROSYBROWN4 0x8b6969
1726
#define MP_INDIANRED1 0xff6a6a
1727
#define MP_INDIANRED2 0xee6363
1728
#define MP_INDIANRED3 0xcd5555
1729
#define MP_INDIANRED4 0x8b3a3a
1730
#define MP_SIENNA1 0xff8247
1731
#define MP_SIENNA2 0xee7942
1732
#define MP_SIENNA3 0xcd6839
1733
#define MP_SIENNA4 0x8b4726
1734
#define MP_BURLYWOOD1 0xffd39b
1735
#define MP_BURLYWOOD2 0xeec591
1736
#define MP_BURLYWOOD3 0xcdaa7d
1737
#define MP_BURLYWOOD4 0x8b7355
1738
#define MP_WHEAT1 0xffe7ba
1739
#define MP_WHEAT2 0xeed8ae
1740
#define MP_WHEAT3 0xcdba96
1741
#define MP_WHEAT4 0x8b7e66
1742
#define MP_TAN1 0xffa54f
1743
#define MP_TAN2 0xee9a49
1744
#define MP_TAN3 0xcd853f
1745
#define MP_TAN4 0x8b5a2b
1746
#define MP_CHOCOLATE1 0xff7f24
1747
#define MP_CHOCOLATE2 0xee7621
1748
#define MP_CHOCOLATE3 0xcd661d
1749
#define MP_CHOCOLATE4 0x8b4513
1750
#define MP_FIREBRICK1 0xff3030
1751
#define MP_FIREBRICK2 0xee2c2c
1752
#define MP_FIREBRICK3 0xcd2626
1753
#define MP_FIREBRICK4 0x8b1a1a
1754
#define MP_BROWN1 0xff4040
1755
#define MP_BROWN2 0xee3b3b
1756
#define MP_BROWN3 0xcd3333
1757
#define MP_BROWN4 0x8b2323
1758
#define MP_SALMON1 0xff8c69
1759
#define MP_SALMON2 0xee8262
1760
#define MP_SALMON3 0xcd7054
1761
#define MP_SALMON4 0x8b4c39
1762
#define MP_LIGHTSALMON1 0xffa07a
1763
#define MP_LIGHTSALMON2 0xee9572
1764
#define MP_LIGHTSALMON3 0xcd8162
1765
#define MP_LIGHTSALMON4 0x8b5742
1766
#define MP_ORANGE1 0xffa500
1767
#define MP_ORANGE2 0xee9a00
1768
#define MP_ORANGE3 0xcd8500
1769
#define MP_ORANGE4 0x8b5a00
1770
#define MP_DARKORANGE1 0xff7f00
1771
#define MP_DARKORANGE2 0xee7600
1772
#define MP_DARKORANGE3 0xcd6600
1773
#define MP_DARKORANGE4 0x8b4500
1774
#define MP_CORAL1 0xff7256
1775
#define MP_CORAL2 0xee6a50
1776
#define MP_CORAL3 0xcd5b45
1777
#define MP_CORAL4 0x8b3e2f
1778
#define MP_TOMATO1 0xff6347
1779
#define MP_TOMATO2 0xee5c42
1780
#define MP_TOMATO3 0xcd4f39
1781
#define MP_TOMATO4 0x8b3626
1782
#define MP_ORANGERED1 0xff4500
1783
#define MP_ORANGERED2 0xee4000
1784
#define MP_ORANGERED3 0xcd3700
1785
#define MP_ORANGERED4 0x8b2500
1786
#define MP_RED1 0xff0000
1787
#define MP_RED2 0xee0000
1788
#define MP_RED3 0xcd0000
1789
#define MP_RED4 0x8b0000
1790
#define MP_DEEPPINK1 0xff1493
1791
#define MP_DEEPPINK2 0xee1289
1792
#define MP_DEEPPINK3 0xcd1076
1793
#define MP_DEEPPINK4 0x8b0a50
1794
#define MP_HOTPINK1 0xff6eb4
1795
#define MP_HOTPINK2 0xee6aa7
1796
#define MP_HOTPINK3 0xcd6090
1797
#define MP_HOTPINK4 0x8b3a62
1798
#define MP_PINK1 0xffb5c5
1799
#define MP_PINK2 0xeea9b8
1800
#define MP_PINK3 0xcd919e
1801
#define MP_PINK4 0x8b636c
1802
#define MP_LIGHTPINK1 0xffaeb9
1803
#define MP_LIGHTPINK2 0xeea2ad
1804
#define MP_LIGHTPINK3 0xcd8c95
1805
#define MP_LIGHTPINK4 0x8b5f65
1806
#define MP_PALEVIOLETRED1 0xff82ab
1807
#define MP_PALEVIOLETRED2 0xee799f
1808
#define MP_PALEVIOLETRED3 0xcd6889
1809
#define MP_PALEVIOLETRED4 0x8b475d
1810
#define MP_MAROON1 0xff34b3
1811
#define MP_MAROON2 0xee30a7
1812
#define MP_MAROON3 0xcd2990
1813
#define MP_MAROON4 0x8b1c62
1814
#define MP_VIOLETRED1 0xff3e96
1815
#define MP_VIOLETRED2 0xee3a8c
1816
#define MP_VIOLETRED3 0xcd3278
1817
#define MP_VIOLETRED4 0x8b2252
1818
#define MP_MAGENTA1 0xff00ff
1819
#define MP_MAGENTA2 0xee00ee
1820
#define MP_MAGENTA3 0xcd00cd
1821
#define MP_MAGENTA4 0x8b008b
1822
#define MP_ORCHID1 0xff83fa
1823
#define MP_ORCHID2 0xee7ae9
1824
#define MP_ORCHID3 0xcd69c9
1825
#define MP_ORCHID4 0x8b4789
1826
#define MP_PLUM1 0xffbbff
1827
#define MP_PLUM2 0xeeaeee
1828
#define MP_PLUM3 0xcd96cd
1829
#define MP_PLUM4 0x8b668b
1830
#define MP_MEDIUMORCHID1 0xe066ff
1831
#define MP_MEDIUMORCHID2 0xd15fee
1832
#define MP_MEDIUMORCHID3 0xb452cd
1833
#define MP_MEDIUMORCHID4 0x7a378b
1834
#define MP_DARKORCHID1 0xbf3eff
1835
#define MP_DARKORCHID2 0xb23aee
1836
#define MP_DARKORCHID3 0x9a32cd
1837
#define MP_DARKORCHID4 0x68228b
1838
#define MP_PURPLE1 0x9b30ff
1839
#define MP_PURPLE2 0x912cee
1840
#define MP_PURPLE3 0x7d26cd
1841
#define MP_PURPLE4 0x551a8b
1842
#define MP_MEDIUMPURPLE1 0xab82ff
1843
#define MP_MEDIUMPURPLE2 0x9f79ee
1844
#define MP_MEDIUMPURPLE3 0x8968cd
1845
#define MP_MEDIUMPURPLE4 0x5d478b
1846
#define MP_THISTLE1 0xffe1ff
1847
#define MP_THISTLE2 0xeed2ee
1848
#define MP_THISTLE3 0xcdb5cd
1849
#define MP_THISTLE4 0x8b7b8b
1850
#define MP_GRAY0 0x000000
1851
#define MP_GREY0 0x000000
1852
#define MP_GRAY1 0x030303
1853
#define MP_GREY1 0x030303
1854
#define MP_GRAY2 0x050505
1855
#define MP_GREY2 0x050505
1856
#define MP_GRAY3 0x080808
1857
#define MP_GREY3 0x080808
1858
#define MP_GRAY4 0x0a0a0a
1859
#define MP_GREY4 0x0a0a0a
1860
#define MP_GRAY5 0x0d0d0d
1861
#define MP_GREY5 0x0d0d0d
1862
#define MP_GRAY6 0x0f0f0f
1863
#define MP_GREY6 0x0f0f0f
1864
#define MP_GRAY7 0x121212
1865
#define MP_GREY7 0x121212
1866
#define MP_GRAY8 0x141414
1867
#define MP_GREY8 0x141414
1868
#define MP_GRAY9 0x171717
1869
#define MP_GREY9 0x171717
1870
#define MP_GRAY10 0x1a1a1a
1871
#define MP_GREY10 0x1a1a1a
1872
#define MP_GRAY11 0x1c1c1c
1873
#define MP_GREY11 0x1c1c1c
1874
#define MP_GRAY12 0x1f1f1f
1875
#define MP_GREY12 0x1f1f1f
1876
#define MP_GRAY13 0x212121
1877
#define MP_GREY13 0x212121
1878
#define MP_GRAY14 0x242424
1879
#define MP_GREY14 0x242424
1880
#define MP_GRAY15 0x262626
1881
#define MP_GREY15 0x262626
1882
#define MP_GRAY16 0x292929
1883
#define MP_GREY16 0x292929
1884
#define MP_GRAY17 0x2b2b2b
1885
#define MP_GREY17 0x2b2b2b
1886
#define MP_GRAY18 0x2e2e2e
1887
#define MP_GREY18 0x2e2e2e
1888
#define MP_GRAY19 0x303030
1889
#define MP_GREY19 0x303030
1890
#define MP_GRAY20 0x333333
1891
#define MP_GREY20 0x333333
1892
#define MP_GRAY21 0x363636
1893
#define MP_GREY21 0x363636
1894
#define MP_GRAY22 0x383838
1895
#define MP_GREY22 0x383838
1896
#define MP_GRAY23 0x3b3b3b
1897
#define MP_GREY23 0x3b3b3b
1898
#define MP_GRAY24 0x3d3d3d
1899
#define MP_GREY24 0x3d3d3d
1900
#define MP_GRAY25 0x404040
1901
#define MP_GREY25 0x404040
1902
#define MP_GRAY26 0x424242
1903
#define MP_GREY26 0x424242
1904
#define MP_GRAY27 0x454545
1905
#define MP_GREY27 0x454545
1906
#define MP_GRAY28 0x474747
1907
#define MP_GREY28 0x474747
1908
#define MP_GRAY29 0x4a4a4a
1909
#define MP_GREY29 0x4a4a4a
1910
#define MP_GRAY30 0x4d4d4d
1911
#define MP_GREY30 0x4d4d4d
1912
#define MP_GRAY31 0x4f4f4f
1913
#define MP_GREY31 0x4f4f4f
1914
#define MP_GRAY32 0x525252
1915
#define MP_GREY32 0x525252
1916
#define MP_GRAY33 0x545454
1917
#define MP_GREY33 0x545454
1918
#define MP_GRAY34 0x575757
1919
#define MP_GREY34 0x575757
1920
#define MP_GRAY35 0x595959
1921
#define MP_GREY35 0x595959
1922
#define MP_GRAY36 0x5c5c5c
1923
#define MP_GREY36 0x5c5c5c
1924
#define MP_GRAY37 0x5e5e5e
1925
#define MP_GREY37 0x5e5e5e
1926
#define MP_GRAY38 0x616161
1927
#define MP_GREY38 0x616161
1928
#define MP_GRAY39 0x636363
1929
#define MP_GREY39 0x636363
1930
#define MP_GRAY40 0x666666
1931
#define MP_GREY40 0x666666
1932
#define MP_GRAY41 0x696969
1933
#define MP_GREY41 0x696969
1934
#define MP_GRAY42 0x6b6b6b
1935
#define MP_GREY42 0x6b6b6b
1936
#define MP_GRAY43 0x6e6e6e
1937
#define MP_GREY43 0x6e6e6e
1938
#define MP_GRAY44 0x707070
1939
#define MP_GREY44 0x707070
1940
#define MP_GRAY45 0x737373
1941
#define MP_GREY45 0x737373
1942
#define MP_GRAY46 0x757575
1943
#define MP_GREY46 0x757575
1944
#define MP_GRAY47 0x787878
1945
#define MP_GREY47 0x787878
1946
#define MP_GRAY48 0x7a7a7a
1947
#define MP_GREY48 0x7a7a7a
1948
#define MP_GRAY49 0x7d7d7d
1949
#define MP_GREY49 0x7d7d7d
1950
#define MP_GRAY50 0x7f7f7f
1951
#define MP_GREY50 0x7f7f7f
1952
#define MP_GRAY51 0x828282
1953
#define MP_GREY51 0x828282
1954
#define MP_GRAY52 0x858585
1955
#define MP_GREY52 0x858585
1956
#define MP_GRAY53 0x878787
1957
#define MP_GREY53 0x878787
1958
#define MP_GRAY54 0x8a8a8a
1959
#define MP_GREY54 0x8a8a8a
1960
#define MP_GRAY55 0x8c8c8c
1961
#define MP_GREY55 0x8c8c8c
1962
#define MP_GRAY56 0x8f8f8f
1963
#define MP_GREY56 0x8f8f8f
1964
#define MP_GRAY57 0x919191
1965
#define MP_GREY57 0x919191
1966
#define MP_GRAY58 0x949494
1967
#define MP_GREY58 0x949494
1968
#define MP_GRAY59 0x969696
1969
#define MP_GREY59 0x969696
1970
#define MP_GRAY60 0x999999
1971
#define MP_GREY60 0x999999
1972
#define MP_GRAY61 0x9c9c9c
1973
#define MP_GREY61 0x9c9c9c
1974
#define MP_GRAY62 0x9e9e9e
1975
#define MP_GREY62 0x9e9e9e
1976
#define MP_GRAY63 0xa1a1a1
1977
#define MP_GREY63 0xa1a1a1
1978
#define MP_GRAY64 0xa3a3a3
1979
#define MP_GREY64 0xa3a3a3
1980
#define MP_GRAY65 0xa6a6a6
1981
#define MP_GREY65 0xa6a6a6
1982
#define MP_GRAY66 0xa8a8a8
1983
#define MP_GREY66 0xa8a8a8
1984
#define MP_GRAY67 0xababab
1985
#define MP_GREY67 0xababab
1986
#define MP_GRAY68 0xadadad
1987
#define MP_GREY68 0xadadad
1988
#define MP_GRAY69 0xb0b0b0
1989
#define MP_GREY69 0xb0b0b0
1990
#define MP_GRAY70 0xb3b3b3
1991
#define MP_GREY70 0xb3b3b3
1992
#define MP_GRAY71 0xb5b5b5
1993
#define MP_GREY71 0xb5b5b5
1994
#define MP_GRAY72 0xb8b8b8
1995
#define MP_GREY72 0xb8b8b8
1996
#define MP_GRAY73 0xbababa
1997
#define MP_GREY73 0xbababa
1998
#define MP_GRAY74 0xbdbdbd
1999
#define MP_GREY74 0xbdbdbd
2000
#define MP_GRAY75 0xbfbfbf
2001
#define MP_GREY75 0xbfbfbf
2002
#define MP_GRAY76 0xc2c2c2
2003
#define MP_GREY76 0xc2c2c2
2004
#define MP_GRAY77 0xc4c4c4
2005
#define MP_GREY77 0xc4c4c4
2006
#define MP_GRAY78 0xc7c7c7
2007
#define MP_GREY78 0xc7c7c7
2008
#define MP_GRAY79 0xc9c9c9
2009
#define MP_GREY79 0xc9c9c9
2010
#define MP_GRAY80 0xcccccc
2011
#define MP_GREY80 0xcccccc
2012
#define MP_GRAY81 0xcfcfcf
2013
#define MP_GREY81 0xcfcfcf
2014
#define MP_GRAY82 0xd1d1d1
2015
#define MP_GREY82 0xd1d1d1
2016
#define MP_GRAY83 0xd4d4d4
2017
#define MP_GREY83 0xd4d4d4
2018
#define MP_GRAY84 0xd6d6d6
2019
#define MP_GREY84 0xd6d6d6
2020
#define MP_GRAY85 0xd9d9d9
2021
#define MP_GREY85 0xd9d9d9
2022
#define MP_GRAY86 0xdbdbdb
2023
#define MP_GREY86 0xdbdbdb
2024
#define MP_GRAY87 0xdedede
2025
#define MP_GREY87 0xdedede
2026
#define MP_GRAY88 0xe0e0e0
2027
#define MP_GREY88 0xe0e0e0
2028
#define MP_GRAY89 0xe3e3e3
2029
#define MP_GREY89 0xe3e3e3
2030
#define MP_GRAY90 0xe5e5e5
2031
#define MP_GREY90 0xe5e5e5
2032
#define MP_GRAY91 0xe8e8e8
2033
#define MP_GREY91 0xe8e8e8
2034
#define MP_GRAY92 0xebebeb
2035
#define MP_GREY92 0xebebeb
2036
#define MP_GRAY93 0xededed
2037
#define MP_GREY93 0xededed
2038
#define MP_GRAY94 0xf0f0f0
2039
#define MP_GREY94 0xf0f0f0
2040
#define MP_GRAY95 0xf2f2f2
2041
#define MP_GREY95 0xf2f2f2
2042
#define MP_GRAY96 0xf5f5f5
2043
#define MP_GREY96 0xf5f5f5
2044
#define MP_GRAY97 0xf7f7f7
2045
#define MP_GREY97 0xf7f7f7
2046
#define MP_GRAY98 0xfafafa
2047
#define MP_GREY98 0xfafafa
2048
#define MP_GRAY99 0xfcfcfc
2049
#define MP_GREY99 0xfcfcfc
2050
#define MP_GRAY100 0xffffff
2051
#define MP_GREY100 0xffffff
2052
#define MP_DARKGREY 0xa9a9a9
2053
#define MP_DARKGRAY 0xa9a9a9
2054
#define MP_DARKBLUE 0x00008b
2055
#define MP_DARKCYAN 0x008b8b
2056
#define MP_DARKMAGENTA 0x8b008b
2057
#define MP_DARKRED 0x8b0000
2058
#define MP_LIGHTGREEN 0x90ee90
2059
2060