diff options
Diffstat (limited to 'externals/microprofile/microprofile.h')
| -rw-r--r-- | externals/microprofile/microprofile.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/externals/microprofile/microprofile.h b/externals/microprofile/microprofile.h index cdb312b87..9d830f7bf 100644 --- a/externals/microprofile/microprofile.h +++ b/externals/microprofile/microprofile.h | |||
| @@ -243,6 +243,7 @@ typedef uint32_t ThreadIdType; | |||
| 243 | #define MICROPROFILE_DEFINE_GPU(var, name, color) MicroProfileToken g_mp_##var = MicroProfileGetToken("GPU", name, color, MicroProfileTokenTypeGpu) | 243 | #define MICROPROFILE_DEFINE_GPU(var, name, color) MicroProfileToken g_mp_##var = MicroProfileGetToken("GPU", name, color, MicroProfileTokenTypeGpu) |
| 244 | #define MICROPROFILE_TOKEN_PASTE0(a, b) a ## b | 244 | #define MICROPROFILE_TOKEN_PASTE0(a, b) a ## b |
| 245 | #define MICROPROFILE_TOKEN_PASTE(a, b) MICROPROFILE_TOKEN_PASTE0(a,b) | 245 | #define MICROPROFILE_TOKEN_PASTE(a, b) MICROPROFILE_TOKEN_PASTE0(a,b) |
| 246 | #define MICROPROFILE_TOKEN(var) g_mp_##var | ||
| 246 | #define MICROPROFILE_SCOPE(var) MicroProfileScopeHandler MICROPROFILE_TOKEN_PASTE(foo, __LINE__)(g_mp_##var) | 247 | #define MICROPROFILE_SCOPE(var) MicroProfileScopeHandler MICROPROFILE_TOKEN_PASTE(foo, __LINE__)(g_mp_##var) |
| 247 | #define MICROPROFILE_SCOPE_TOKEN(token) MicroProfileScopeHandler MICROPROFILE_TOKEN_PASTE(foo, __LINE__)(token) | 248 | #define MICROPROFILE_SCOPE_TOKEN(token) MicroProfileScopeHandler MICROPROFILE_TOKEN_PASTE(foo, __LINE__)(token) |
| 248 | #define MICROPROFILE_SCOPEI(group, name, color) static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mp,__LINE__) = MicroProfileGetToken(group, name, color, MicroProfileTokenTypeCpu); MicroProfileScopeHandler MICROPROFILE_TOKEN_PASTE(foo,__LINE__)( MICROPROFILE_TOKEN_PASTE(g_mp,__LINE__)) | 249 | #define MICROPROFILE_SCOPEI(group, name, color) static MicroProfileToken MICROPROFILE_TOKEN_PASTE(g_mp,__LINE__) = MicroProfileGetToken(group, name, color, MicroProfileTokenTypeCpu); MicroProfileScopeHandler MICROPROFILE_TOKEN_PASTE(foo,__LINE__)( MICROPROFILE_TOKEN_PASTE(g_mp,__LINE__)) |
| @@ -827,7 +828,7 @@ inline MicroProfileLogEntry MicroProfileMakeLogIndex(uint64_t nBegin, MicroProfi | |||
| 827 | MicroProfileLogEntry Entry = (nBegin<<62) | ((0x3fff&nToken)<<48) | (MP_LOG_TICK_MASK&nTick); | 828 | MicroProfileLogEntry Entry = (nBegin<<62) | ((0x3fff&nToken)<<48) | (MP_LOG_TICK_MASK&nTick); |
| 828 | int t = MicroProfileLogType(Entry); | 829 | int t = MicroProfileLogType(Entry); |
| 829 | uint64_t nTimerIndex = MicroProfileLogTimerIndex(Entry); | 830 | uint64_t nTimerIndex = MicroProfileLogTimerIndex(Entry); |
| 830 | MP_ASSERT(t == nBegin); | 831 | MP_ASSERT((uint64_t)t == nBegin); |
| 831 | MP_ASSERT(nTimerIndex == (nToken&0x3fff)); | 832 | MP_ASSERT(nTimerIndex == (nToken&0x3fff)); |
| 832 | return Entry; | 833 | return Entry; |
| 833 | 834 | ||
| @@ -1555,10 +1556,10 @@ void MicroProfileFlip() | |||
| 1555 | 1556 | ||
| 1556 | pFramePut->nFrameStartCpu = MP_TICK(); | 1557 | pFramePut->nFrameStartCpu = MP_TICK(); |
| 1557 | pFramePut->nFrameStartGpu = (uint32_t)MicroProfileGpuInsertTimeStamp(); | 1558 | pFramePut->nFrameStartGpu = (uint32_t)MicroProfileGpuInsertTimeStamp(); |
| 1558 | if(pFrameNext->nFrameStartGpu != (uint64_t)-1) | 1559 | if(pFrameNext->nFrameStartGpu != -1) |
| 1559 | pFrameNext->nFrameStartGpu = MicroProfileGpuGetTimeStamp((uint32_t)pFrameNext->nFrameStartGpu); | 1560 | pFrameNext->nFrameStartGpu = MicroProfileGpuGetTimeStamp((uint32_t)pFrameNext->nFrameStartGpu); |
| 1560 | 1561 | ||
| 1561 | if(pFrameCurrent->nFrameStartGpu == (uint64_t)-1) | 1562 | if(pFrameCurrent->nFrameStartGpu == -1) |
| 1562 | pFrameCurrent->nFrameStartGpu = pFrameNext->nFrameStartGpu + 1; | 1563 | pFrameCurrent->nFrameStartGpu = pFrameNext->nFrameStartGpu + 1; |
| 1563 | 1564 | ||
| 1564 | uint64_t nFrameStartCpu = pFrameCurrent->nFrameStartCpu; | 1565 | uint64_t nFrameStartCpu = pFrameCurrent->nFrameStartCpu; |