diff options
| -rw-r--r-- | externals/microprofile/microprofile.h | 20 | ||||
| -rw-r--r-- | externals/microprofile/microprofileui.h | 108 | ||||
| -rw-r--r-- | src/core/crypto/partition_data_manager.cpp | 7 | ||||
| -rw-r--r-- | src/core/hle/service/bcat/backend/boxcat.cpp | 7 | ||||
| -rw-r--r-- | src/core/hle/service/es/es.cpp | 1 | ||||
| -rw-r--r-- | src/tests/core/core_timing.cpp | 18 | ||||
| -rw-r--r-- | src/video_core/engines/fermi_2d.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/shader/control_flow.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/textures/decoders.cpp | 3 | ||||
| -rw-r--r-- | src/video_core/textures/decoders.h | 5 | ||||
| -rw-r--r-- | src/yuzu/applets/profile_select.cpp | 2 |
11 files changed, 89 insertions, 88 deletions
diff --git a/externals/microprofile/microprofile.h b/externals/microprofile/microprofile.h index 9d830f7bf..0c0d0a4d3 100644 --- a/externals/microprofile/microprofile.h +++ b/externals/microprofile/microprofile.h | |||
| @@ -910,14 +910,14 @@ typedef void* (*MicroProfileThreadFunc)(void*); | |||
| 910 | 910 | ||
| 911 | #ifndef _WIN32 | 911 | #ifndef _WIN32 |
| 912 | typedef pthread_t MicroProfileThread; | 912 | typedef pthread_t MicroProfileThread; |
| 913 | void MicroProfileThreadStart(MicroProfileThread* pThread, MicroProfileThreadFunc Func) | 913 | inline void MicroProfileThreadStart(MicroProfileThread* pThread, MicroProfileThreadFunc Func) |
| 914 | { | 914 | { |
| 915 | pthread_attr_t Attr; | 915 | pthread_attr_t Attr; |
| 916 | int r = pthread_attr_init(&Attr); | 916 | int r = pthread_attr_init(&Attr); |
| 917 | MP_ASSERT(r == 0); | 917 | MP_ASSERT(r == 0); |
| 918 | pthread_create(pThread, &Attr, Func, 0); | 918 | pthread_create(pThread, &Attr, Func, 0); |
| 919 | } | 919 | } |
| 920 | void MicroProfileThreadJoin(MicroProfileThread* pThread) | 920 | inline void MicroProfileThreadJoin(MicroProfileThread* pThread) |
| 921 | { | 921 | { |
| 922 | int r = pthread_join(*pThread, 0); | 922 | int r = pthread_join(*pThread, 0); |
| 923 | MP_ASSERT(r == 0); | 923 | MP_ASSERT(r == 0); |
| @@ -930,11 +930,11 @@ DWORD _stdcall ThreadTrampoline(void* pFunc) | |||
| 930 | return (uint32_t)F(0); | 930 | return (uint32_t)F(0); |
| 931 | } | 931 | } |
| 932 | 932 | ||
| 933 | void MicroProfileThreadStart(MicroProfileThread* pThread, MicroProfileThreadFunc Func) | 933 | inline void MicroProfileThreadStart(MicroProfileThread* pThread, MicroProfileThreadFunc Func) |
| 934 | { | 934 | { |
| 935 | *pThread = CreateThread(0, 0, ThreadTrampoline, Func, 0, 0); | 935 | *pThread = CreateThread(0, 0, ThreadTrampoline, Func, 0, 0); |
| 936 | } | 936 | } |
| 937 | void MicroProfileThreadJoin(MicroProfileThread* pThread) | 937 | inline void MicroProfileThreadJoin(MicroProfileThread* pThread) |
| 938 | { | 938 | { |
| 939 | WaitForSingleObject(*pThread, INFINITE); | 939 | WaitForSingleObject(*pThread, INFINITE); |
| 940 | CloseHandle(*pThread); | 940 | CloseHandle(*pThread); |
| @@ -1131,7 +1131,7 @@ inline void MicroProfileSetThreadLog(MicroProfileThreadLog* pLog) | |||
| 1131 | pthread_setspecific(g_MicroProfileThreadLogKey, pLog); | 1131 | pthread_setspecific(g_MicroProfileThreadLogKey, pLog); |
| 1132 | } | 1132 | } |
| 1133 | #else | 1133 | #else |
| 1134 | MicroProfileThreadLog* MicroProfileGetThreadLog() | 1134 | inline MicroProfileThreadLog* MicroProfileGetThreadLog() |
| 1135 | { | 1135 | { |
| 1136 | return g_MicroProfileThreadLog; | 1136 | return g_MicroProfileThreadLog; |
| 1137 | } | 1137 | } |
| @@ -1247,7 +1247,7 @@ MicroProfileToken MicroProfileFindToken(const char* pGroup, const char* pName) | |||
| 1247 | return MICROPROFILE_INVALID_TOKEN; | 1247 | return MICROPROFILE_INVALID_TOKEN; |
| 1248 | } | 1248 | } |
| 1249 | 1249 | ||
| 1250 | uint16_t MicroProfileGetGroup(const char* pGroup, MicroProfileTokenType Type) | 1250 | inline uint16_t MicroProfileGetGroup(const char* pGroup, MicroProfileTokenType Type) |
| 1251 | { | 1251 | { |
| 1252 | for(uint32_t i = 0; i < S.nGroupCount; ++i) | 1252 | for(uint32_t i = 0; i < S.nGroupCount; ++i) |
| 1253 | { | 1253 | { |
| @@ -1276,7 +1276,7 @@ uint16_t MicroProfileGetGroup(const char* pGroup, MicroProfileTokenType Type) | |||
| 1276 | return nGroupIndex; | 1276 | return nGroupIndex; |
| 1277 | } | 1277 | } |
| 1278 | 1278 | ||
| 1279 | void MicroProfileRegisterGroup(const char* pGroup, const char* pCategory, uint32_t nColor) | 1279 | inline void MicroProfileRegisterGroup(const char* pGroup, const char* pCategory, uint32_t nColor) |
| 1280 | { | 1280 | { |
| 1281 | int nCategoryIndex = -1; | 1281 | int nCategoryIndex = -1; |
| 1282 | for(uint32_t i = 0; i < S.nCategoryCount; ++i) | 1282 | for(uint32_t i = 0; i < S.nCategoryCount; ++i) |
| @@ -1442,7 +1442,7 @@ void MicroProfileGpuLeave(MicroProfileToken nToken_, uint64_t nTickStart) | |||
| 1442 | } | 1442 | } |
| 1443 | } | 1443 | } |
| 1444 | 1444 | ||
| 1445 | void MicroProfileContextSwitchPut(MicroProfileContextSwitch* pContextSwitch) | 1445 | inline void MicroProfileContextSwitchPut(MicroProfileContextSwitch* pContextSwitch) |
| 1446 | { | 1446 | { |
| 1447 | if(S.nRunning || pContextSwitch->nTicks <= S.nPauseTicks) | 1447 | if(S.nRunning || pContextSwitch->nTicks <= S.nPauseTicks) |
| 1448 | { | 1448 | { |
| @@ -1894,7 +1894,7 @@ void MicroProfileSetEnableAllGroups(bool bEnableAllGroups) | |||
| 1894 | S.nAllGroupsWanted = bEnableAllGroups ? 1 : 0; | 1894 | S.nAllGroupsWanted = bEnableAllGroups ? 1 : 0; |
| 1895 | } | 1895 | } |
| 1896 | 1896 | ||
| 1897 | void MicroProfileEnableCategory(const char* pCategory, bool bEnabled) | 1897 | inline void MicroProfileEnableCategory(const char* pCategory, bool bEnabled) |
| 1898 | { | 1898 | { |
| 1899 | int nCategoryIndex = -1; | 1899 | int nCategoryIndex = -1; |
| 1900 | for(uint32_t i = 0; i < S.nCategoryCount; ++i) | 1900 | for(uint32_t i = 0; i < S.nCategoryCount; ++i) |
| @@ -2004,7 +2004,7 @@ void MicroProfileForceDisableGroup(const char* pGroup, MicroProfileTokenType Typ | |||
| 2004 | } | 2004 | } |
| 2005 | 2005 | ||
| 2006 | 2006 | ||
| 2007 | void MicroProfileCalcAllTimers(float* pTimers, float* pAverage, float* pMax, float* pCallAverage, float* pExclusive, float* pAverageExclusive, float* pMaxExclusive, float* pTotal, uint32_t nSize) | 2007 | inline void MicroProfileCalcAllTimers(float* pTimers, float* pAverage, float* pMax, float* pCallAverage, float* pExclusive, float* pAverageExclusive, float* pMaxExclusive, float* pTotal, uint32_t nSize) |
| 2008 | { | 2008 | { |
| 2009 | for(uint32_t i = 0; i < S.nTotalTimers && i < nSize; ++i) | 2009 | for(uint32_t i = 0; i < S.nTotalTimers && i < nSize; ++i) |
| 2010 | { | 2010 | { |
diff --git a/externals/microprofile/microprofileui.h b/externals/microprofile/microprofileui.h index ddaebe55b..fe2410cf4 100644 --- a/externals/microprofile/microprofileui.h +++ b/externals/microprofile/microprofileui.h | |||
| @@ -417,19 +417,19 @@ void MicroProfileToggleDisplayMode() | |||
| 417 | } | 417 | } |
| 418 | 418 | ||
| 419 | 419 | ||
| 420 | void MicroProfileStringArrayClear(MicroProfileStringArray* pArray) | 420 | inline void MicroProfileStringArrayClear(MicroProfileStringArray* pArray) |
| 421 | { | 421 | { |
| 422 | pArray->nNumStrings = 0; | 422 | pArray->nNumStrings = 0; |
| 423 | pArray->pBufferPos = &pArray->Buffer[0]; | 423 | pArray->pBufferPos = &pArray->Buffer[0]; |
| 424 | } | 424 | } |
| 425 | 425 | ||
| 426 | void MicroProfileStringArrayAddLiteral(MicroProfileStringArray* pArray, const char* pLiteral) | 426 | inline void MicroProfileStringArrayAddLiteral(MicroProfileStringArray* pArray, const char* pLiteral) |
| 427 | { | 427 | { |
| 428 | MP_ASSERT(pArray->nNumStrings < MICROPROFILE_TOOLTIP_MAX_STRINGS); | 428 | MP_ASSERT(pArray->nNumStrings < MICROPROFILE_TOOLTIP_MAX_STRINGS); |
| 429 | pArray->ppStrings[pArray->nNumStrings++] = pLiteral; | 429 | pArray->ppStrings[pArray->nNumStrings++] = pLiteral; |
| 430 | } | 430 | } |
| 431 | 431 | ||
| 432 | void MicroProfileStringArrayFormat(MicroProfileStringArray* pArray, const char* fmt, ...) | 432 | inline void MicroProfileStringArrayFormat(MicroProfileStringArray* pArray, const char* fmt, ...) |
| 433 | { | 433 | { |
| 434 | MP_ASSERT(pArray->nNumStrings < MICROPROFILE_TOOLTIP_MAX_STRINGS); | 434 | MP_ASSERT(pArray->nNumStrings < MICROPROFILE_TOOLTIP_MAX_STRINGS); |
| 435 | pArray->ppStrings[pArray->nNumStrings++] = pArray->pBufferPos; | 435 | pArray->ppStrings[pArray->nNumStrings++] = pArray->pBufferPos; |
| @@ -439,7 +439,7 @@ void MicroProfileStringArrayFormat(MicroProfileStringArray* pArray, const char* | |||
| 439 | va_end(args); | 439 | va_end(args); |
| 440 | MP_ASSERT(pArray->pBufferPos < pArray->Buffer + MICROPROFILE_TOOLTIP_STRING_BUFFER_SIZE); | 440 | MP_ASSERT(pArray->pBufferPos < pArray->Buffer + MICROPROFILE_TOOLTIP_STRING_BUFFER_SIZE); |
| 441 | } | 441 | } |
| 442 | void MicroProfileStringArrayCopy(MicroProfileStringArray* pDest, MicroProfileStringArray* pSrc) | 442 | inline void MicroProfileStringArrayCopy(MicroProfileStringArray* pDest, MicroProfileStringArray* pSrc) |
| 443 | { | 443 | { |
| 444 | memcpy(&pDest->ppStrings[0], &pSrc->ppStrings[0], sizeof(pDest->ppStrings)); | 444 | memcpy(&pDest->ppStrings[0], &pSrc->ppStrings[0], sizeof(pDest->ppStrings)); |
| 445 | memcpy(&pDest->Buffer[0], &pSrc->Buffer[0], sizeof(pDest->Buffer)); | 445 | memcpy(&pDest->Buffer[0], &pSrc->Buffer[0], sizeof(pDest->Buffer)); |
| @@ -456,7 +456,7 @@ void MicroProfileStringArrayCopy(MicroProfileStringArray* pDest, MicroProfileStr | |||
| 456 | pDest->nNumStrings = pSrc->nNumStrings; | 456 | pDest->nNumStrings = pSrc->nNumStrings; |
| 457 | } | 457 | } |
| 458 | 458 | ||
| 459 | void MicroProfileFloatWindowSize(const char** ppStrings, uint32_t nNumStrings, uint32_t* pColors, uint32_t& nWidth, uint32_t& nHeight, uint32_t* pStringLengths = 0) | 459 | inline void MicroProfileFloatWindowSize(const char** ppStrings, uint32_t nNumStrings, uint32_t* pColors, uint32_t& nWidth, uint32_t& nHeight, uint32_t* pStringLengths = 0) |
| 460 | { | 460 | { |
| 461 | uint32_t* nStringLengths = pStringLengths ? pStringLengths : (uint32_t*)alloca(nNumStrings * sizeof(uint32_t)); | 461 | uint32_t* nStringLengths = pStringLengths ? pStringLengths : (uint32_t*)alloca(nNumStrings * sizeof(uint32_t)); |
| 462 | uint32_t nTextCount = nNumStrings/2; | 462 | uint32_t nTextCount = nNumStrings/2; |
| @@ -474,7 +474,7 @@ void MicroProfileFloatWindowSize(const char** ppStrings, uint32_t nNumStrings, u | |||
| 474 | nHeight = (MICROPROFILE_TEXT_HEIGHT+1) * nTextCount + 2 * MICROPROFILE_BORDER_SIZE; | 474 | nHeight = (MICROPROFILE_TEXT_HEIGHT+1) * nTextCount + 2 * MICROPROFILE_BORDER_SIZE; |
| 475 | } | 475 | } |
| 476 | 476 | ||
| 477 | void MicroProfileDrawFloatWindow(uint32_t nX, uint32_t nY, const char** ppStrings, uint32_t nNumStrings, uint32_t nColor, uint32_t* pColors = 0) | 477 | inline void MicroProfileDrawFloatWindow(uint32_t nX, uint32_t nY, const char** ppStrings, uint32_t nNumStrings, uint32_t nColor, uint32_t* pColors = 0) |
| 478 | { | 478 | { |
| 479 | uint32_t nWidth = 0, nHeight = 0; | 479 | uint32_t nWidth = 0, nHeight = 0; |
| 480 | uint32_t* nStringLengths = (uint32_t*)alloca(nNumStrings * sizeof(uint32_t)); | 480 | uint32_t* nStringLengths = (uint32_t*)alloca(nNumStrings * sizeof(uint32_t)); |
| @@ -503,7 +503,7 @@ void MicroProfileDrawFloatWindow(uint32_t nX, uint32_t nY, const char** ppString | |||
| 503 | nY += (MICROPROFILE_TEXT_HEIGHT+1); | 503 | nY += (MICROPROFILE_TEXT_HEIGHT+1); |
| 504 | } | 504 | } |
| 505 | } | 505 | } |
| 506 | void MicroProfileDrawTextBox(uint32_t nX, uint32_t nY, const char** ppStrings, uint32_t nNumStrings, uint32_t nColor, uint32_t* pColors = 0) | 506 | inline void MicroProfileDrawTextBox(uint32_t nX, uint32_t nY, const char** ppStrings, uint32_t nNumStrings, uint32_t nColor, uint32_t* pColors = 0) |
| 507 | { | 507 | { |
| 508 | uint32_t nWidth = 0, nHeight = 0; | 508 | uint32_t nWidth = 0, nHeight = 0; |
| 509 | uint32_t* nStringLengths = (uint32_t*)alloca(nNumStrings * sizeof(uint32_t)); | 509 | uint32_t* nStringLengths = (uint32_t*)alloca(nNumStrings * sizeof(uint32_t)); |
| @@ -529,7 +529,7 @@ void MicroProfileDrawTextBox(uint32_t nX, uint32_t nY, const char** ppStrings, u | |||
| 529 | 529 | ||
| 530 | 530 | ||
| 531 | 531 | ||
| 532 | void MicroProfileToolTipMeta(MicroProfileStringArray* pToolTip) | 532 | inline void MicroProfileToolTipMeta(MicroProfileStringArray* pToolTip) |
| 533 | { | 533 | { |
| 534 | MicroProfile& S = *MicroProfileGet(); | 534 | MicroProfile& S = *MicroProfileGet(); |
| 535 | if(UI.nRangeBeginIndex != UI.nRangeEndIndex && UI.pRangeLog) | 535 | if(UI.nRangeBeginIndex != UI.nRangeEndIndex && UI.pRangeLog) |
| @@ -608,7 +608,7 @@ void MicroProfileToolTipMeta(MicroProfileStringArray* pToolTip) | |||
| 608 | } | 608 | } |
| 609 | } | 609 | } |
| 610 | 610 | ||
| 611 | void MicroProfileDrawFloatTooltip(uint32_t nX, uint32_t nY, uint32_t nToken, uint64_t nTime) | 611 | inline void MicroProfileDrawFloatTooltip(uint32_t nX, uint32_t nY, uint32_t nToken, uint64_t nTime) |
| 612 | { | 612 | { |
| 613 | MicroProfile& S = *MicroProfileGet(); | 613 | MicroProfile& S = *MicroProfileGet(); |
| 614 | 614 | ||
| @@ -718,7 +718,7 @@ void MicroProfileDrawFloatTooltip(uint32_t nX, uint32_t nY, uint32_t nToken, uin | |||
| 718 | } | 718 | } |
| 719 | 719 | ||
| 720 | 720 | ||
| 721 | void MicroProfileZoomTo(int64_t nTickStart, int64_t nTickEnd) | 721 | inline void MicroProfileZoomTo(int64_t nTickStart, int64_t nTickEnd) |
| 722 | { | 722 | { |
| 723 | MicroProfile& S = *MicroProfileGet(); | 723 | MicroProfile& S = *MicroProfileGet(); |
| 724 | 724 | ||
| @@ -728,7 +728,7 @@ void MicroProfileZoomTo(int64_t nTickStart, int64_t nTickEnd) | |||
| 728 | UI.fDetailedRangeTarget = MicroProfileLogTickDifference(nTickStart, nTickEnd) * fToMs; | 728 | UI.fDetailedRangeTarget = MicroProfileLogTickDifference(nTickStart, nTickEnd) * fToMs; |
| 729 | } | 729 | } |
| 730 | 730 | ||
| 731 | void MicroProfileCenter(int64_t nTickCenter) | 731 | inline void MicroProfileCenter(int64_t nTickCenter) |
| 732 | { | 732 | { |
| 733 | MicroProfile& S = *MicroProfileGet(); | 733 | MicroProfile& S = *MicroProfileGet(); |
| 734 | int64_t nStart = S.Frames[S.nFrameCurrent].nFrameStartCpu; | 734 | int64_t nStart = S.Frames[S.nFrameCurrent].nFrameStartCpu; |
| @@ -739,7 +739,7 @@ void MicroProfileCenter(int64_t nTickCenter) | |||
| 739 | #ifdef MICROPROFILE_DEBUG | 739 | #ifdef MICROPROFILE_DEBUG |
| 740 | uint64_t* g_pMicroProfileDumpStart = 0; | 740 | uint64_t* g_pMicroProfileDumpStart = 0; |
| 741 | uint64_t* g_pMicroProfileDumpEnd = 0; | 741 | uint64_t* g_pMicroProfileDumpEnd = 0; |
| 742 | void MicroProfileDebugDumpRange() | 742 | inline void MicroProfileDebugDumpRange() |
| 743 | { | 743 | { |
| 744 | MicroProfile& S = *MicroProfileGet(); | 744 | MicroProfile& S = *MicroProfileGet(); |
| 745 | if(g_pMicroProfileDumpStart != g_pMicroProfileDumpEnd) | 745 | if(g_pMicroProfileDumpStart != g_pMicroProfileDumpEnd) |
| @@ -777,7 +777,7 @@ void MicroProfileDebugDumpRange() | |||
| 777 | 777 | ||
| 778 | #define MICROPROFILE_HOVER_DIST 0.5f | 778 | #define MICROPROFILE_HOVER_DIST 0.5f |
| 779 | 779 | ||
| 780 | void MicroProfileDrawDetailedContextSwitchBars(uint32_t nY, uint32_t nThreadId, uint32_t nContextSwitchStart, uint32_t nContextSwitchEnd, int64_t nBaseTicks, uint32_t nBaseY) | 780 | inline void MicroProfileDrawDetailedContextSwitchBars(uint32_t nY, uint32_t nThreadId, uint32_t nContextSwitchStart, uint32_t nContextSwitchEnd, int64_t nBaseTicks, uint32_t nBaseY) |
| 781 | { | 781 | { |
| 782 | MicroProfile& S = *MicroProfileGet(); | 782 | MicroProfile& S = *MicroProfileGet(); |
| 783 | int64_t nTickIn = -1; | 783 | int64_t nTickIn = -1; |
| @@ -841,7 +841,7 @@ void MicroProfileDrawDetailedContextSwitchBars(uint32_t nY, uint32_t nThreadId, | |||
| 841 | } | 841 | } |
| 842 | } | 842 | } |
| 843 | 843 | ||
| 844 | void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY, int nSelectedFrame) | 844 | inline void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY, int nSelectedFrame) |
| 845 | { | 845 | { |
| 846 | MicroProfile& S = *MicroProfileGet(); | 846 | MicroProfile& S = *MicroProfileGet(); |
| 847 | MP_DEBUG_DUMP_RANGE(); | 847 | MP_DEBUG_DUMP_RANGE(); |
| @@ -1325,7 +1325,7 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY, | |||
| 1325 | } | 1325 | } |
| 1326 | 1326 | ||
| 1327 | 1327 | ||
| 1328 | void MicroProfileDrawDetailedFrameHistory(uint32_t nWidth, uint32_t nHeight, uint32_t nBaseY, uint32_t nSelectedFrame) | 1328 | inline void MicroProfileDrawDetailedFrameHistory(uint32_t nWidth, uint32_t nHeight, uint32_t nBaseY, uint32_t nSelectedFrame) |
| 1329 | { | 1329 | { |
| 1330 | MicroProfile& S = *MicroProfileGet(); | 1330 | MicroProfile& S = *MicroProfileGet(); |
| 1331 | 1331 | ||
| @@ -1379,7 +1379,7 @@ void MicroProfileDrawDetailedFrameHistory(uint32_t nWidth, uint32_t nHeight, uin | |||
| 1379 | } | 1379 | } |
| 1380 | MicroProfileDrawBox(fSelectionStart, nBaseY, fSelectionEnd, nBaseY+MICROPROFILE_FRAME_HISTORY_HEIGHT, MICROPROFILE_FRAME_HISTORY_COLOR_HIGHTLIGHT, MicroProfileBoxTypeFlat); | 1380 | MicroProfileDrawBox(fSelectionStart, nBaseY, fSelectionEnd, nBaseY+MICROPROFILE_FRAME_HISTORY_HEIGHT, MICROPROFILE_FRAME_HISTORY_COLOR_HIGHTLIGHT, MicroProfileBoxTypeFlat); |
| 1381 | } | 1381 | } |
| 1382 | void MicroProfileDrawDetailedView(uint32_t nWidth, uint32_t nHeight) | 1382 | inline void MicroProfileDrawDetailedView(uint32_t nWidth, uint32_t nHeight) |
| 1383 | { | 1383 | { |
| 1384 | MicroProfile& S = *MicroProfileGet(); | 1384 | MicroProfile& S = *MicroProfileGet(); |
| 1385 | 1385 | ||
| @@ -1416,11 +1416,11 @@ void MicroProfileDrawDetailedView(uint32_t nWidth, uint32_t nHeight) | |||
| 1416 | MicroProfileDrawDetailedFrameHistory(nWidth, nHeight, nBaseY, nSelectedFrame); | 1416 | MicroProfileDrawDetailedFrameHistory(nWidth, nHeight, nBaseY, nSelectedFrame); |
| 1417 | } | 1417 | } |
| 1418 | 1418 | ||
| 1419 | void MicroProfileDrawTextRight(uint32_t nX, uint32_t nY, uint32_t nColor, const char* pStr, uint32_t nStrLen) | 1419 | inline void MicroProfileDrawTextRight(uint32_t nX, uint32_t nY, uint32_t nColor, const char* pStr, uint32_t nStrLen) |
| 1420 | { | 1420 | { |
| 1421 | MicroProfileDrawText(nX - nStrLen * (MICROPROFILE_TEXT_WIDTH+1), nY, nColor, pStr, nStrLen); | 1421 | MicroProfileDrawText(nX - nStrLen * (MICROPROFILE_TEXT_WIDTH+1), nY, nColor, pStr, nStrLen); |
| 1422 | } | 1422 | } |
| 1423 | void MicroProfileDrawHeader(int32_t nX, uint32_t nWidth, const char* pName) | 1423 | inline void MicroProfileDrawHeader(int32_t nX, uint32_t nWidth, const char* pName) |
| 1424 | { | 1424 | { |
| 1425 | if(pName) | 1425 | if(pName) |
| 1426 | { | 1426 | { |
| @@ -1432,7 +1432,7 @@ void MicroProfileDrawHeader(int32_t nX, uint32_t nWidth, const char* pName) | |||
| 1432 | 1432 | ||
| 1433 | typedef void (*MicroProfileLoopGroupCallback)(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pData); | 1433 | typedef void (*MicroProfileLoopGroupCallback)(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pData); |
| 1434 | 1434 | ||
| 1435 | void MicroProfileLoopActiveGroupsDraw(int32_t nX, int32_t nY, const char* pName, MicroProfileLoopGroupCallback CB, void* pData) | 1435 | inline void MicroProfileLoopActiveGroupsDraw(int32_t nX, int32_t nY, const char* pName, MicroProfileLoopGroupCallback CB, void* pData) |
| 1436 | { | 1436 | { |
| 1437 | MicroProfile& S = *MicroProfileGet(); | 1437 | MicroProfile& S = *MicroProfileGet(); |
| 1438 | nY += MICROPROFILE_TEXT_HEIGHT + 2; | 1438 | nY += MICROPROFILE_TEXT_HEIGHT + 2; |
| @@ -1465,7 +1465,7 @@ void MicroProfileLoopActiveGroupsDraw(int32_t nX, int32_t nY, const char* pName, | |||
| 1465 | } | 1465 | } |
| 1466 | 1466 | ||
| 1467 | 1467 | ||
| 1468 | void MicroProfileCalcTimers(float* pTimers, float* pAverage, float* pMax, float* pCallAverage, float* pExclusive, float* pAverageExclusive, float* pMaxExclusive, uint64_t nGroup, uint32_t nSize) | 1468 | inline void MicroProfileCalcTimers(float* pTimers, float* pAverage, float* pMax, float* pCallAverage, float* pExclusive, float* pAverageExclusive, float* pMaxExclusive, uint64_t nGroup, uint32_t nSize) |
| 1469 | { | 1469 | { |
| 1470 | MicroProfile& S = *MicroProfileGet(); | 1470 | MicroProfile& S = *MicroProfileGet(); |
| 1471 | 1471 | ||
| @@ -1527,7 +1527,7 @@ void MicroProfileCalcTimers(float* pTimers, float* pAverage, float* pMax, float* | |||
| 1527 | 1527 | ||
| 1528 | #define SBUF_MAX 32 | 1528 | #define SBUF_MAX 32 |
| 1529 | 1529 | ||
| 1530 | void MicroProfileDrawBarArrayCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra) | 1530 | inline void MicroProfileDrawBarArrayCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra) |
| 1531 | { | 1531 | { |
| 1532 | const uint32_t nHeight = MICROPROFILE_TEXT_HEIGHT; | 1532 | const uint32_t nHeight = MICROPROFILE_TEXT_HEIGHT; |
| 1533 | const uint32_t nTextWidth = 6 * (1+MICROPROFILE_TEXT_WIDTH); | 1533 | const uint32_t nTextWidth = 6 * (1+MICROPROFILE_TEXT_WIDTH); |
| @@ -1547,7 +1547,7 @@ void MicroProfileDrawBarArrayCallback(uint32_t nTimer, uint32_t nIdx, uint64_t n | |||
| 1547 | } | 1547 | } |
| 1548 | 1548 | ||
| 1549 | 1549 | ||
| 1550 | uint32_t MicroProfileDrawBarArray(int32_t nX, int32_t nY, float* pTimers, const char* pName, uint32_t nTotalHeight, float* pTimers2 = NULL) | 1550 | inline uint32_t MicroProfileDrawBarArray(int32_t nX, int32_t nY, float* pTimers, const char* pName, uint32_t nTotalHeight, float* pTimers2 = NULL) |
| 1551 | { | 1551 | { |
| 1552 | const uint32_t nTextWidth = 6 * (1+MICROPROFILE_TEXT_WIDTH); | 1552 | const uint32_t nTextWidth = 6 * (1+MICROPROFILE_TEXT_WIDTH); |
| 1553 | const uint32_t nWidth = MICROPROFILE_BAR_WIDTH; | 1553 | const uint32_t nWidth = MICROPROFILE_BAR_WIDTH; |
| @@ -1559,7 +1559,7 @@ uint32_t MicroProfileDrawBarArray(int32_t nX, int32_t nY, float* pTimers, const | |||
| 1559 | return nWidth + 5 + nTextWidth; | 1559 | return nWidth + 5 + nTextWidth; |
| 1560 | 1560 | ||
| 1561 | } | 1561 | } |
| 1562 | void MicroProfileDrawBarCallCountCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra) | 1562 | inline void MicroProfileDrawBarCallCountCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra) |
| 1563 | { | 1563 | { |
| 1564 | MicroProfile& S = *MicroProfileGet(); | 1564 | MicroProfile& S = *MicroProfileGet(); |
| 1565 | char sBuffer[SBUF_MAX]; | 1565 | char sBuffer[SBUF_MAX]; |
| @@ -1567,7 +1567,7 @@ void MicroProfileDrawBarCallCountCallback(uint32_t nTimer, uint32_t nIdx, uint64 | |||
| 1567 | MicroProfileDrawText(nX, nY, (uint32_t)-1, sBuffer, nLen); | 1567 | MicroProfileDrawText(nX, nY, (uint32_t)-1, sBuffer, nLen); |
| 1568 | } | 1568 | } |
| 1569 | 1569 | ||
| 1570 | uint32_t MicroProfileDrawBarCallCount(int32_t nX, int32_t nY, const char* pName) | 1570 | inline uint32_t MicroProfileDrawBarCallCount(int32_t nX, int32_t nY, const char* pName) |
| 1571 | { | 1571 | { |
| 1572 | MicroProfileLoopActiveGroupsDraw(nX, nY, pName, MicroProfileDrawBarCallCountCallback, 0); | 1572 | MicroProfileLoopActiveGroupsDraw(nX, nY, pName, MicroProfileDrawBarCallCountCallback, 0); |
| 1573 | const uint32_t nTextWidth = 6 * MICROPROFILE_TEXT_WIDTH; | 1573 | const uint32_t nTextWidth = 6 * MICROPROFILE_TEXT_WIDTH; |
| @@ -1581,7 +1581,7 @@ struct MicroProfileMetaAverageArgs | |||
| 1581 | float fRcpFrames; | 1581 | float fRcpFrames; |
| 1582 | }; | 1582 | }; |
| 1583 | 1583 | ||
| 1584 | void MicroProfileDrawBarMetaAverageCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra) | 1584 | inline void MicroProfileDrawBarMetaAverageCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra) |
| 1585 | { | 1585 | { |
| 1586 | MicroProfileMetaAverageArgs* pArgs = (MicroProfileMetaAverageArgs*)pExtra; | 1586 | MicroProfileMetaAverageArgs* pArgs = (MicroProfileMetaAverageArgs*)pExtra; |
| 1587 | uint64_t* pCounters = pArgs->pCounters; | 1587 | uint64_t* pCounters = pArgs->pCounters; |
| @@ -1591,7 +1591,7 @@ void MicroProfileDrawBarMetaAverageCallback(uint32_t nTimer, uint32_t nIdx, uint | |||
| 1591 | MicroProfileDrawText(nX - nLen * (MICROPROFILE_TEXT_WIDTH+1), nY, (uint32_t)-1, sBuffer, nLen); | 1591 | MicroProfileDrawText(nX - nLen * (MICROPROFILE_TEXT_WIDTH+1), nY, (uint32_t)-1, sBuffer, nLen); |
| 1592 | } | 1592 | } |
| 1593 | 1593 | ||
| 1594 | uint32_t MicroProfileDrawBarMetaAverage(int32_t nX, int32_t nY, uint64_t* pCounters, const char* pName, uint32_t nTotalHeight) | 1594 | inline uint32_t MicroProfileDrawBarMetaAverage(int32_t nX, int32_t nY, uint64_t* pCounters, const char* pName, uint32_t nTotalHeight) |
| 1595 | { | 1595 | { |
| 1596 | if(!pName) | 1596 | if(!pName) |
| 1597 | return 0; | 1597 | return 0; |
| @@ -1605,7 +1605,7 @@ uint32_t MicroProfileDrawBarMetaAverage(int32_t nX, int32_t nY, uint64_t* pCount | |||
| 1605 | } | 1605 | } |
| 1606 | 1606 | ||
| 1607 | 1607 | ||
| 1608 | void MicroProfileDrawBarMetaCountCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra) | 1608 | inline void MicroProfileDrawBarMetaCountCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra) |
| 1609 | { | 1609 | { |
| 1610 | uint64_t* pCounters = (uint64_t*)pExtra; | 1610 | uint64_t* pCounters = (uint64_t*)pExtra; |
| 1611 | char sBuffer[SBUF_MAX]; | 1611 | char sBuffer[SBUF_MAX]; |
| @@ -1613,7 +1613,7 @@ void MicroProfileDrawBarMetaCountCallback(uint32_t nTimer, uint32_t nIdx, uint64 | |||
| 1613 | MicroProfileDrawText(nX - nLen * (MICROPROFILE_TEXT_WIDTH+1), nY, (uint32_t)-1, sBuffer, nLen); | 1613 | MicroProfileDrawText(nX - nLen * (MICROPROFILE_TEXT_WIDTH+1), nY, (uint32_t)-1, sBuffer, nLen); |
| 1614 | } | 1614 | } |
| 1615 | 1615 | ||
| 1616 | uint32_t MicroProfileDrawBarMetaCount(int32_t nX, int32_t nY, uint64_t* pCounters, const char* pName, uint32_t nTotalHeight) | 1616 | inline uint32_t MicroProfileDrawBarMetaCount(int32_t nX, int32_t nY, uint64_t* pCounters, const char* pName, uint32_t nTotalHeight) |
| 1617 | { | 1617 | { |
| 1618 | if(!pName) | 1618 | if(!pName) |
| 1619 | return 0; | 1619 | return 0; |
| @@ -1625,7 +1625,7 @@ uint32_t MicroProfileDrawBarMetaCount(int32_t nX, int32_t nY, uint64_t* pCounter | |||
| 1625 | return 5 + nTextWidth; | 1625 | return 5 + nTextWidth; |
| 1626 | } | 1626 | } |
| 1627 | 1627 | ||
| 1628 | void MicroProfileDrawBarLegendCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra) | 1628 | inline void MicroProfileDrawBarLegendCallback(uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY, void* pExtra) |
| 1629 | { | 1629 | { |
| 1630 | MicroProfile& S = *MicroProfileGet(); | 1630 | MicroProfile& S = *MicroProfileGet(); |
| 1631 | if (S.TimerInfo[nTimer].bGraph) | 1631 | if (S.TimerInfo[nTimer].bGraph) |
| @@ -1640,7 +1640,7 @@ void MicroProfileDrawBarLegendCallback(uint32_t nTimer, uint32_t nIdx, uint64_t | |||
| 1640 | } | 1640 | } |
| 1641 | } | 1641 | } |
| 1642 | 1642 | ||
| 1643 | uint32_t MicroProfileDrawBarLegend(int32_t nX, int32_t nY, uint32_t nTotalHeight, uint32_t nMaxWidth) | 1643 | inline uint32_t MicroProfileDrawBarLegend(int32_t nX, int32_t nY, uint32_t nTotalHeight, uint32_t nMaxWidth) |
| 1644 | { | 1644 | { |
| 1645 | MicroProfileDrawLineVertical(nX-5, nY, nTotalHeight, UI.nOpacityBackground | g_nMicroProfileBackColors[0]|g_nMicroProfileBackColors[1]); | 1645 | MicroProfileDrawLineVertical(nX-5, nY, nTotalHeight, UI.nOpacityBackground | g_nMicroProfileBackColors[0]|g_nMicroProfileBackColors[1]); |
| 1646 | MicroProfileLoopActiveGroupsDraw(nMaxWidth, nY, 0, MicroProfileDrawBarLegendCallback, 0); | 1646 | MicroProfileLoopActiveGroupsDraw(nMaxWidth, nY, 0, MicroProfileDrawBarLegendCallback, 0); |
| @@ -1807,7 +1807,7 @@ void MicroProfileDumpTimers() | |||
| 1807 | } | 1807 | } |
| 1808 | } | 1808 | } |
| 1809 | 1809 | ||
| 1810 | void MicroProfileDrawBarView(uint32_t nScreenWidth, uint32_t nScreenHeight) | 1810 | inline void MicroProfileDrawBarView(uint32_t nScreenWidth, uint32_t nScreenHeight) |
| 1811 | { | 1811 | { |
| 1812 | MicroProfile& S = *MicroProfileGet(); | 1812 | MicroProfile& S = *MicroProfileGet(); |
| 1813 | 1813 | ||
| @@ -1951,7 +1951,7 @@ typedef const char* (*MicroProfileSubmenuCallback)(int, bool* bSelected); | |||
| 1951 | typedef void (*MicroProfileClickCallback)(int); | 1951 | typedef void (*MicroProfileClickCallback)(int); |
| 1952 | 1952 | ||
| 1953 | 1953 | ||
| 1954 | const char* MicroProfileUIMenuMode(int nIndex, bool* bSelected) | 1954 | inline const char* MicroProfileUIMenuMode(int nIndex, bool* bSelected) |
| 1955 | { | 1955 | { |
| 1956 | MicroProfile& S = *MicroProfileGet(); | 1956 | MicroProfile& S = *MicroProfileGet(); |
| 1957 | switch(nIndex) | 1957 | switch(nIndex) |
| @@ -1979,7 +1979,7 @@ const char* MicroProfileUIMenuMode(int nIndex, bool* bSelected) | |||
| 1979 | } | 1979 | } |
| 1980 | } | 1980 | } |
| 1981 | 1981 | ||
| 1982 | const char* MicroProfileUIMenuGroups(int nIndex, bool* bSelected) | 1982 | inline const char* MicroProfileUIMenuGroups(int nIndex, bool* bSelected) |
| 1983 | { | 1983 | { |
| 1984 | MicroProfile& S = *MicroProfileGet(); | 1984 | MicroProfile& S = *MicroProfileGet(); |
| 1985 | *bSelected = false; | 1985 | *bSelected = false; |
| @@ -2012,7 +2012,7 @@ const char* MicroProfileUIMenuGroups(int nIndex, bool* bSelected) | |||
| 2012 | } | 2012 | } |
| 2013 | } | 2013 | } |
| 2014 | 2014 | ||
| 2015 | const char* MicroProfileUIMenuAggregate(int nIndex, bool* bSelected) | 2015 | inline const char* MicroProfileUIMenuAggregate(int nIndex, bool* bSelected) |
| 2016 | { | 2016 | { |
| 2017 | MicroProfile& S = *MicroProfileGet(); | 2017 | MicroProfile& S = *MicroProfileGet(); |
| 2018 | if(nIndex < sizeof(g_MicroProfileAggregatePresets)/sizeof(g_MicroProfileAggregatePresets[0])) | 2018 | if(nIndex < sizeof(g_MicroProfileAggregatePresets)/sizeof(g_MicroProfileAggregatePresets[0])) |
| @@ -2032,7 +2032,7 @@ const char* MicroProfileUIMenuAggregate(int nIndex, bool* bSelected) | |||
| 2032 | 2032 | ||
| 2033 | } | 2033 | } |
| 2034 | 2034 | ||
| 2035 | const char* MicroProfileUIMenuTimers(int nIndex, bool* bSelected) | 2035 | inline const char* MicroProfileUIMenuTimers(int nIndex, bool* bSelected) |
| 2036 | { | 2036 | { |
| 2037 | MicroProfile& S = *MicroProfileGet(); | 2037 | MicroProfile& S = *MicroProfileGet(); |
| 2038 | *bSelected = 0 != (S.nBars & (1 << nIndex)); | 2038 | *bSelected = 0 != (S.nBars & (1 << nIndex)); |
| @@ -2054,7 +2054,7 @@ const char* MicroProfileUIMenuTimers(int nIndex, bool* bSelected) | |||
| 2054 | return 0; | 2054 | return 0; |
| 2055 | } | 2055 | } |
| 2056 | 2056 | ||
| 2057 | const char* MicroProfileUIMenuOptions(int nIndex, bool* bSelected) | 2057 | inline const char* MicroProfileUIMenuOptions(int nIndex, bool* bSelected) |
| 2058 | { | 2058 | { |
| 2059 | MicroProfile& S = *MicroProfileGet(); | 2059 | MicroProfile& S = *MicroProfileGet(); |
| 2060 | if(nIndex >= MICROPROFILE_OPTION_SIZE) return 0; | 2060 | if(nIndex >= MICROPROFILE_OPTION_SIZE) return 0; |
| @@ -2094,7 +2094,7 @@ const char* MicroProfileUIMenuOptions(int nIndex, bool* bSelected) | |||
| 2094 | return UI.Options[nIndex].Text; | 2094 | return UI.Options[nIndex].Text; |
| 2095 | } | 2095 | } |
| 2096 | 2096 | ||
| 2097 | const char* MicroProfileUIMenuPreset(int nIndex, bool* bSelected) | 2097 | inline const char* MicroProfileUIMenuPreset(int nIndex, bool* bSelected) |
| 2098 | { | 2098 | { |
| 2099 | static char buf[128]; | 2099 | static char buf[128]; |
| 2100 | *bSelected = false; | 2100 | *bSelected = false; |
| @@ -2118,7 +2118,7 @@ const char* MicroProfileUIMenuPreset(int nIndex, bool* bSelected) | |||
| 2118 | } | 2118 | } |
| 2119 | } | 2119 | } |
| 2120 | 2120 | ||
| 2121 | const char* MicroProfileUIMenuCustom(int nIndex, bool* bSelected) | 2121 | inline const char* MicroProfileUIMenuCustom(int nIndex, bool* bSelected) |
| 2122 | { | 2122 | { |
| 2123 | if((uint32_t)-1 == UI.nCustomActive) | 2123 | if((uint32_t)-1 == UI.nCustomActive) |
| 2124 | { | 2124 | { |
| @@ -2145,13 +2145,13 @@ const char* MicroProfileUIMenuCustom(int nIndex, bool* bSelected) | |||
| 2145 | } | 2145 | } |
| 2146 | } | 2146 | } |
| 2147 | 2147 | ||
| 2148 | const char* MicroProfileUIMenuEmpty(int nIndex, bool* bSelected) | 2148 | inline const char* MicroProfileUIMenuEmpty(int nIndex, bool* bSelected) |
| 2149 | { | 2149 | { |
| 2150 | return 0; | 2150 | return 0; |
| 2151 | } | 2151 | } |
| 2152 | 2152 | ||
| 2153 | 2153 | ||
| 2154 | void MicroProfileUIClickMode(int nIndex) | 2154 | inline void MicroProfileUIClickMode(int nIndex) |
| 2155 | { | 2155 | { |
| 2156 | MicroProfile& S = *MicroProfileGet(); | 2156 | MicroProfile& S = *MicroProfileGet(); |
| 2157 | switch(nIndex) | 2157 | switch(nIndex) |
| @@ -2176,7 +2176,7 @@ void MicroProfileUIClickMode(int nIndex) | |||
| 2176 | } | 2176 | } |
| 2177 | } | 2177 | } |
| 2178 | 2178 | ||
| 2179 | void MicroProfileUIClickGroups(int nIndex) | 2179 | inline void MicroProfileUIClickGroups(int nIndex) |
| 2180 | { | 2180 | { |
| 2181 | MicroProfile& S = *MicroProfileGet(); | 2181 | MicroProfile& S = *MicroProfileGet(); |
| 2182 | if(nIndex == 0) | 2182 | if(nIndex == 0) |
| @@ -2208,7 +2208,7 @@ void MicroProfileUIClickGroups(int nIndex) | |||
| 2208 | } | 2208 | } |
| 2209 | } | 2209 | } |
| 2210 | 2210 | ||
| 2211 | void MicroProfileUIClickAggregate(int nIndex) | 2211 | inline void MicroProfileUIClickAggregate(int nIndex) |
| 2212 | { | 2212 | { |
| 2213 | MicroProfile& S = *MicroProfileGet(); | 2213 | MicroProfile& S = *MicroProfileGet(); |
| 2214 | S.nAggregateFlip = g_MicroProfileAggregatePresets[nIndex]; | 2214 | S.nAggregateFlip = g_MicroProfileAggregatePresets[nIndex]; |
| @@ -2218,13 +2218,13 @@ void MicroProfileUIClickAggregate(int nIndex) | |||
| 2218 | } | 2218 | } |
| 2219 | } | 2219 | } |
| 2220 | 2220 | ||
| 2221 | void MicroProfileUIClickTimers(int nIndex) | 2221 | inline void MicroProfileUIClickTimers(int nIndex) |
| 2222 | { | 2222 | { |
| 2223 | MicroProfile& S = *MicroProfileGet(); | 2223 | MicroProfile& S = *MicroProfileGet(); |
| 2224 | S.nBars ^= (1 << nIndex); | 2224 | S.nBars ^= (1 << nIndex); |
| 2225 | } | 2225 | } |
| 2226 | 2226 | ||
| 2227 | void MicroProfileUIClickOptions(int nIndex) | 2227 | inline void MicroProfileUIClickOptions(int nIndex) |
| 2228 | { | 2228 | { |
| 2229 | MicroProfile& S = *MicroProfileGet(); | 2229 | MicroProfile& S = *MicroProfileGet(); |
| 2230 | switch(UI.Options[nIndex].nSubType) | 2230 | switch(UI.Options[nIndex].nSubType) |
| @@ -2271,7 +2271,7 @@ void MicroProfileUIClickOptions(int nIndex) | |||
| 2271 | } | 2271 | } |
| 2272 | } | 2272 | } |
| 2273 | 2273 | ||
| 2274 | void MicroProfileUIClickPreset(int nIndex) | 2274 | inline void MicroProfileUIClickPreset(int nIndex) |
| 2275 | { | 2275 | { |
| 2276 | int nNumPresets = sizeof(g_MicroProfilePresetNames) / sizeof(g_MicroProfilePresetNames[0]); | 2276 | int nNumPresets = sizeof(g_MicroProfilePresetNames) / sizeof(g_MicroProfilePresetNames[0]); |
| 2277 | int nIndexSave = nIndex - nNumPresets - 1; | 2277 | int nIndexSave = nIndex - nNumPresets - 1; |
| @@ -2285,7 +2285,7 @@ void MicroProfileUIClickPreset(int nIndex) | |||
| 2285 | } | 2285 | } |
| 2286 | } | 2286 | } |
| 2287 | 2287 | ||
| 2288 | void MicroProfileUIClickCustom(int nIndex) | 2288 | inline void MicroProfileUIClickCustom(int nIndex) |
| 2289 | { | 2289 | { |
| 2290 | if(nIndex == 0) | 2290 | if(nIndex == 0) |
| 2291 | { | 2291 | { |
| @@ -2298,13 +2298,13 @@ void MicroProfileUIClickCustom(int nIndex) | |||
| 2298 | 2298 | ||
| 2299 | } | 2299 | } |
| 2300 | 2300 | ||
| 2301 | void MicroProfileUIClickEmpty(int nIndex) | 2301 | inline void MicroProfileUIClickEmpty(int nIndex) |
| 2302 | { | 2302 | { |
| 2303 | 2303 | ||
| 2304 | } | 2304 | } |
| 2305 | 2305 | ||
| 2306 | 2306 | ||
| 2307 | void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight) | 2307 | inline void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight) |
| 2308 | { | 2308 | { |
| 2309 | MicroProfile& S = *MicroProfileGet(); | 2309 | MicroProfile& S = *MicroProfileGet(); |
| 2310 | 2310 | ||
| @@ -2489,7 +2489,7 @@ void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight) | |||
| 2489 | } | 2489 | } |
| 2490 | 2490 | ||
| 2491 | 2491 | ||
| 2492 | void MicroProfileMoveGraph() | 2492 | inline void MicroProfileMoveGraph() |
| 2493 | { | 2493 | { |
| 2494 | 2494 | ||
| 2495 | int nZoom = UI.nMouseWheelDelta; | 2495 | int nZoom = UI.nMouseWheelDelta; |
| @@ -2536,7 +2536,7 @@ void MicroProfileMoveGraph() | |||
| 2536 | UI.nOffsetY = 0; | 2536 | UI.nOffsetY = 0; |
| 2537 | } | 2537 | } |
| 2538 | 2538 | ||
| 2539 | void MicroProfileDrawCustom(uint32_t nWidth, uint32_t nHeight) | 2539 | inline void MicroProfileDrawCustom(uint32_t nWidth, uint32_t nHeight) |
| 2540 | { | 2540 | { |
| 2541 | if((uint32_t)-1 != UI.nCustomActive) | 2541 | if((uint32_t)-1 != UI.nCustomActive) |
| 2542 | { | 2542 | { |
| @@ -2633,7 +2633,7 @@ void MicroProfileDrawCustom(uint32_t nWidth, uint32_t nHeight) | |||
| 2633 | } | 2633 | } |
| 2634 | } | 2634 | } |
| 2635 | } | 2635 | } |
| 2636 | void MicroProfileDraw(uint32_t nWidth, uint32_t nHeight) | 2636 | inline void MicroProfileDraw(uint32_t nWidth, uint32_t nHeight) |
| 2637 | { | 2637 | { |
| 2638 | MICROPROFILE_SCOPE(g_MicroProfileDraw); | 2638 | MICROPROFILE_SCOPE(g_MicroProfileDraw); |
| 2639 | MicroProfile& S = *MicroProfileGet(); | 2639 | MicroProfile& S = *MicroProfileGet(); |
| @@ -3226,7 +3226,7 @@ void MicroProfileLoadPreset(const char* pSuffix) | |||
| 3226 | } | 3226 | } |
| 3227 | } | 3227 | } |
| 3228 | 3228 | ||
| 3229 | uint32_t MicroProfileCustomGroupFind(const char* pCustomName) | 3229 | inline uint32_t MicroProfileCustomGroupFind(const char* pCustomName) |
| 3230 | { | 3230 | { |
| 3231 | for(uint32_t i = 0; i < UI.nCustomCount; ++i) | 3231 | for(uint32_t i = 0; i < UI.nCustomCount; ++i) |
| 3232 | { | 3232 | { |
| @@ -3238,7 +3238,7 @@ uint32_t MicroProfileCustomGroupFind(const char* pCustomName) | |||
| 3238 | return (uint32_t)-1; | 3238 | return (uint32_t)-1; |
| 3239 | } | 3239 | } |
| 3240 | 3240 | ||
| 3241 | uint32_t MicroProfileCustomGroup(const char* pCustomName) | 3241 | inline uint32_t MicroProfileCustomGroup(const char* pCustomName) |
| 3242 | { | 3242 | { |
| 3243 | for(uint32_t i = 0; i < UI.nCustomCount; ++i) | 3243 | for(uint32_t i = 0; i < UI.nCustomCount; ++i) |
| 3244 | { | 3244 | { |
| @@ -3271,7 +3271,7 @@ void MicroProfileCustomGroup(const char* pCustomName, uint32_t nMaxTimers, uint3 | |||
| 3271 | UI.Custom[nIndex].nAggregateFlip = nAggregateFlip; | 3271 | UI.Custom[nIndex].nAggregateFlip = nAggregateFlip; |
| 3272 | } | 3272 | } |
| 3273 | 3273 | ||
| 3274 | void MicroProfileCustomGroupEnable(uint32_t nIndex) | 3274 | inline void MicroProfileCustomGroupEnable(uint32_t nIndex) |
| 3275 | { | 3275 | { |
| 3276 | if(nIndex < UI.nCustomCount) | 3276 | if(nIndex < UI.nCustomCount) |
| 3277 | { | 3277 | { |
diff --git a/src/core/crypto/partition_data_manager.cpp b/src/core/crypto/partition_data_manager.cpp index d64302f2e..7ed71ac3a 100644 --- a/src/core/crypto/partition_data_manager.cpp +++ b/src/core/crypto/partition_data_manager.cpp | |||
| @@ -202,8 +202,8 @@ static std::array<Key128, 0x20> FindEncryptedMasterKeyFromHex(const std::vector< | |||
| 202 | return out; | 202 | return out; |
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | FileSys::VirtualFile FindFileInDirWithNames(const FileSys::VirtualDir& dir, | 205 | static FileSys::VirtualFile FindFileInDirWithNames(const FileSys::VirtualDir& dir, |
| 206 | const std::string& name) { | 206 | const std::string& name) { |
| 207 | const auto upper = Common::ToUpper(name); | 207 | const auto upper = Common::ToUpper(name); |
| 208 | 208 | ||
| 209 | for (const auto& fname : {name, name + ".bin", upper, upper + ".BIN"}) { | 209 | for (const auto& fname : {name, name + ".bin", upper, upper + ".BIN"}) { |
| @@ -345,8 +345,7 @@ FileSys::VirtualFile PartitionDataManager::GetPackage2Raw(Package2Type type) con | |||
| 345 | return package2.at(static_cast<size_t>(type)); | 345 | return package2.at(static_cast<size_t>(type)); |
| 346 | } | 346 | } |
| 347 | 347 | ||
| 348 | bool AttemptDecrypt(const std::array<u8, 16>& key, Package2Header& header) { | 348 | static bool AttemptDecrypt(const std::array<u8, 16>& key, Package2Header& header) { |
| 349 | |||
| 350 | const std::vector<u8> iv(header.header_ctr.begin(), header.header_ctr.end()); | 349 | const std::vector<u8> iv(header.header_ctr.begin(), header.header_ctr.end()); |
| 351 | Package2Header temp = header; | 350 | Package2Header temp = header; |
| 352 | AESCipher<Key128> cipher(key, Mode::CTR); | 351 | AESCipher<Key128> cipher(key, Mode::CTR); |
diff --git a/src/core/hle/service/bcat/backend/boxcat.cpp b/src/core/hle/service/bcat/backend/boxcat.cpp index f589864ee..5febe8fc1 100644 --- a/src/core/hle/service/bcat/backend/boxcat.cpp +++ b/src/core/hle/service/bcat/backend/boxcat.cpp | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include "core/hle/service/bcat/backend/boxcat.h" | 18 | #include "core/hle/service/bcat/backend/boxcat.h" |
| 19 | #include "core/settings.h" | 19 | #include "core/settings.h" |
| 20 | 20 | ||
| 21 | namespace Service::BCAT { | ||
| 21 | namespace { | 22 | namespace { |
| 22 | 23 | ||
| 23 | // Prevents conflicts with windows macro called CreateFile | 24 | // Prevents conflicts with windows macro called CreateFile |
| @@ -30,10 +31,6 @@ bool VfsDeleteFileWrap(FileSys::VirtualDir dir, std::string_view name) { | |||
| 30 | return dir->DeleteFile(name); | 31 | return dir->DeleteFile(name); |
| 31 | } | 32 | } |
| 32 | 33 | ||
| 33 | } // Anonymous namespace | ||
| 34 | |||
| 35 | namespace Service::BCAT { | ||
| 36 | |||
| 37 | constexpr ResultCode ERROR_GENERAL_BCAT_FAILURE{ErrorModule::BCAT, 1}; | 34 | constexpr ResultCode ERROR_GENERAL_BCAT_FAILURE{ErrorModule::BCAT, 1}; |
| 38 | 35 | ||
| 39 | constexpr char BOXCAT_HOSTNAME[] = "api.yuzu-emu.org"; | 36 | constexpr char BOXCAT_HOSTNAME[] = "api.yuzu-emu.org"; |
| @@ -90,8 +87,6 @@ constexpr u32 PORT = 443; | |||
| 90 | constexpr u32 TIMEOUT_SECONDS = 30; | 87 | constexpr u32 TIMEOUT_SECONDS = 30; |
| 91 | [[maybe_unused]] constexpr u64 VFS_COPY_BLOCK_SIZE = 1ULL << 24; // 4MB | 88 | [[maybe_unused]] constexpr u64 VFS_COPY_BLOCK_SIZE = 1ULL << 24; // 4MB |
| 92 | 89 | ||
| 93 | namespace { | ||
| 94 | |||
| 95 | std::string GetBINFilePath(u64 title_id) { | 90 | std::string GetBINFilePath(u64 title_id) { |
| 96 | return fmt::format("{}bcat/{:016X}/launchparam.bin", | 91 | return fmt::format("{}bcat/{:016X}/launchparam.bin", |
| 97 | FileUtil::GetUserPath(FileUtil::UserPath::CacheDir), title_id); | 92 | FileUtil::GetUserPath(FileUtil::UserPath::CacheDir), title_id); |
diff --git a/src/core/hle/service/es/es.cpp b/src/core/hle/service/es/es.cpp index df00ae625..1f37bc4d6 100644 --- a/src/core/hle/service/es/es.cpp +++ b/src/core/hle/service/es/es.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include "core/crypto/key_manager.h" | 5 | #include "core/crypto/key_manager.h" |
| 6 | #include "core/hle/ipc_helpers.h" | 6 | #include "core/hle/ipc_helpers.h" |
| 7 | #include "core/hle/service/es/es.h" | ||
| 7 | #include "core/hle/service/service.h" | 8 | #include "core/hle/service/service.h" |
| 8 | 9 | ||
| 9 | namespace Service::ES { | 10 | namespace Service::ES { |
diff --git a/src/tests/core/core_timing.cpp b/src/tests/core/core_timing.cpp index 1e3940801..ff2d11cc8 100644 --- a/src/tests/core/core_timing.cpp +++ b/src/tests/core/core_timing.cpp | |||
| @@ -14,13 +14,14 @@ | |||
| 14 | #include "core/core.h" | 14 | #include "core/core.h" |
| 15 | #include "core/core_timing.h" | 15 | #include "core/core_timing.h" |
| 16 | 16 | ||
| 17 | namespace { | ||
| 17 | // Numbers are chosen randomly to make sure the correct one is given. | 18 | // Numbers are chosen randomly to make sure the correct one is given. |
| 18 | static constexpr std::array<u64, 5> CB_IDS{{42, 144, 93, 1026, UINT64_C(0xFFFF7FFFF7FFFF)}}; | 19 | constexpr std::array<u64, 5> CB_IDS{{42, 144, 93, 1026, UINT64_C(0xFFFF7FFFF7FFFF)}}; |
| 19 | static constexpr int MAX_SLICE_LENGTH = 10000; // Copied from CoreTiming internals | 20 | constexpr int MAX_SLICE_LENGTH = 10000; // Copied from CoreTiming internals |
| 20 | 21 | ||
| 21 | static std::bitset<CB_IDS.size()> callbacks_ran_flags; | 22 | std::bitset<CB_IDS.size()> callbacks_ran_flags; |
| 22 | static u64 expected_callback = 0; | 23 | u64 expected_callback = 0; |
| 23 | static s64 lateness = 0; | 24 | s64 lateness = 0; |
| 24 | 25 | ||
| 25 | template <unsigned int IDX> | 26 | template <unsigned int IDX> |
| 26 | void CallbackTemplate(u64 userdata, s64 cycles_late) { | 27 | void CallbackTemplate(u64 userdata, s64 cycles_late) { |
| @@ -31,7 +32,7 @@ void CallbackTemplate(u64 userdata, s64 cycles_late) { | |||
| 31 | REQUIRE(lateness == cycles_late); | 32 | REQUIRE(lateness == cycles_late); |
| 32 | } | 33 | } |
| 33 | 34 | ||
| 34 | static u64 callbacks_done = 0; | 35 | u64 callbacks_done = 0; |
| 35 | 36 | ||
| 36 | void EmptyCallback(u64 userdata, s64 cycles_late) { | 37 | void EmptyCallback(u64 userdata, s64 cycles_late) { |
| 37 | ++callbacks_done; | 38 | ++callbacks_done; |
| @@ -48,8 +49,8 @@ struct ScopeInit final { | |||
| 48 | Core::Timing::CoreTiming core_timing; | 49 | Core::Timing::CoreTiming core_timing; |
| 49 | }; | 50 | }; |
| 50 | 51 | ||
| 51 | static void AdvanceAndCheck(Core::Timing::CoreTiming& core_timing, u32 idx, u32 context = 0, | 52 | void AdvanceAndCheck(Core::Timing::CoreTiming& core_timing, u32 idx, u32 context = 0, |
| 52 | int expected_lateness = 0, int cpu_downcount = 0) { | 53 | int expected_lateness = 0, int cpu_downcount = 0) { |
| 53 | callbacks_ran_flags = 0; | 54 | callbacks_ran_flags = 0; |
| 54 | expected_callback = CB_IDS[idx]; | 55 | expected_callback = CB_IDS[idx]; |
| 55 | lateness = expected_lateness; | 56 | lateness = expected_lateness; |
| @@ -62,6 +63,7 @@ static void AdvanceAndCheck(Core::Timing::CoreTiming& core_timing, u32 idx, u32 | |||
| 62 | 63 | ||
| 63 | REQUIRE(decltype(callbacks_ran_flags)().set(idx) == callbacks_ran_flags); | 64 | REQUIRE(decltype(callbacks_ran_flags)().set(idx) == callbacks_ran_flags); |
| 64 | } | 65 | } |
| 66 | } // Anonymous namespace | ||
| 65 | 67 | ||
| 66 | TEST_CASE("CoreTiming[BasicOrder]", "[core]") { | 68 | TEST_CASE("CoreTiming[BasicOrder]", "[core]") { |
| 67 | ScopeInit guard; | 69 | ScopeInit guard; |
diff --git a/src/video_core/engines/fermi_2d.cpp b/src/video_core/engines/fermi_2d.cpp index 85d308e26..bace6affb 100644 --- a/src/video_core/engines/fermi_2d.cpp +++ b/src/video_core/engines/fermi_2d.cpp | |||
| @@ -28,7 +28,7 @@ void Fermi2D::CallMethod(const GPU::MethodCall& method_call) { | |||
| 28 | } | 28 | } |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | std::pair<u32, u32> DelimitLine(u32 src_1, u32 src_2, u32 dst_1, u32 dst_2, u32 src_line) { | 31 | static std::pair<u32, u32> DelimitLine(u32 src_1, u32 src_2, u32 dst_1, u32 dst_2, u32 src_line) { |
| 32 | const u32 line_a = src_2 - src_1; | 32 | const u32 line_a = src_2 - src_1; |
| 33 | const u32 line_b = dst_2 - dst_1; | 33 | const u32 line_b = dst_2 - dst_1; |
| 34 | const u32 excess = std::max<s32>(0, line_a - src_line + src_1); | 34 | const u32 excess = std::max<s32>(0, line_a - src_line + src_1); |
diff --git a/src/video_core/shader/control_flow.cpp b/src/video_core/shader/control_flow.cpp index 6d313963a..e00a3fb70 100644 --- a/src/video_core/shader/control_flow.cpp +++ b/src/video_core/shader/control_flow.cpp | |||
| @@ -587,8 +587,6 @@ bool TryQuery(CFGRebuildState& state) { | |||
| 587 | return true; | 587 | return true; |
| 588 | } | 588 | } |
| 589 | 589 | ||
| 590 | } // Anonymous namespace | ||
| 591 | |||
| 592 | void InsertBranch(ASTManager& mm, const BlockBranchInfo& branch_info) { | 590 | void InsertBranch(ASTManager& mm, const BlockBranchInfo& branch_info) { |
| 593 | const auto get_expr = ([&](const Condition& cond) -> Expr { | 591 | const auto get_expr = ([&](const Condition& cond) -> Expr { |
| 594 | Expr result{}; | 592 | Expr result{}; |
| @@ -655,6 +653,8 @@ void DecompileShader(CFGRebuildState& state) { | |||
| 655 | state.manager->Decompile(); | 653 | state.manager->Decompile(); |
| 656 | } | 654 | } |
| 657 | 655 | ||
| 656 | } // Anonymous namespace | ||
| 657 | |||
| 658 | std::unique_ptr<ShaderCharacteristics> ScanFlow(const ProgramCode& program_code, u32 start_address, | 658 | std::unique_ptr<ShaderCharacteristics> ScanFlow(const ProgramCode& program_code, u32 start_address, |
| 659 | const CompilerSettings& settings, | 659 | const CompilerSettings& settings, |
| 660 | Registry& registry) { | 660 | Registry& registry) { |
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index 7df5f1452..fae8638ec 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include "video_core/textures/texture.h" | 11 | #include "video_core/textures/texture.h" |
| 12 | 12 | ||
| 13 | namespace Tegra::Texture { | 13 | namespace Tegra::Texture { |
| 14 | namespace { | ||
| 14 | 15 | ||
| 15 | /** | 16 | /** |
| 16 | * This table represents the internal swizzle of a gob, | 17 | * This table represents the internal swizzle of a gob, |
| @@ -174,6 +175,8 @@ void SwizzledData(u8* const swizzled_data, u8* const unswizzled_data, const bool | |||
| 174 | } | 175 | } |
| 175 | } | 176 | } |
| 176 | 177 | ||
| 178 | } // Anonymous namespace | ||
| 179 | |||
| 177 | void CopySwizzledData(u32 width, u32 height, u32 depth, u32 bytes_per_pixel, | 180 | void CopySwizzledData(u32 width, u32 height, u32 depth, u32 bytes_per_pixel, |
| 178 | u32 out_bytes_per_pixel, u8* const swizzled_data, u8* const unswizzled_data, | 181 | u32 out_bytes_per_pixel, u8* const swizzled_data, u8* const unswizzled_data, |
| 179 | bool unswizzle, u32 block_height, u32 block_depth, u32 width_spacing) { | 182 | bool unswizzle, u32 block_height, u32 block_depth, u32 width_spacing) { |
diff --git a/src/video_core/textures/decoders.h b/src/video_core/textures/decoders.h index e5eac3f3b..9f2d6d308 100644 --- a/src/video_core/textures/decoders.h +++ b/src/video_core/textures/decoders.h | |||
| @@ -56,8 +56,7 @@ void UnswizzleSubrect(u32 subrect_width, u32 subrect_height, u32 dest_pitch, u32 | |||
| 56 | u32 bytes_per_pixel, u8* swizzled_data, u8* unswizzled_data, u32 block_height, | 56 | u32 bytes_per_pixel, u8* swizzled_data, u8* unswizzled_data, u32 block_height, |
| 57 | u32 offset_x, u32 offset_y); | 57 | u32 offset_x, u32 offset_y); |
| 58 | 58 | ||
| 59 | void SwizzleKepler(const u32 width, const u32 height, const u32 dst_x, const u32 dst_y, | 59 | void SwizzleKepler(u32 width, u32 height, u32 dst_x, u32 dst_y, u32 block_height, |
| 60 | const u32 block_height, const std::size_t copy_size, const u8* source_data, | 60 | std::size_t copy_size, const u8* source_data, u8* swizzle_data); |
| 61 | u8* swizzle_data); | ||
| 62 | 61 | ||
| 63 | } // namespace Tegra::Texture | 62 | } // namespace Tegra::Texture |
diff --git a/src/yuzu/applets/profile_select.cpp b/src/yuzu/applets/profile_select.cpp index 6aff38735..4bc8ee726 100644 --- a/src/yuzu/applets/profile_select.cpp +++ b/src/yuzu/applets/profile_select.cpp | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include "yuzu/applets/profile_select.h" | 17 | #include "yuzu/applets/profile_select.h" |
| 18 | #include "yuzu/main.h" | 18 | #include "yuzu/main.h" |
| 19 | 19 | ||
| 20 | namespace { | ||
| 20 | QString FormatUserEntryText(const QString& username, Common::UUID uuid) { | 21 | QString FormatUserEntryText(const QString& username, Common::UUID uuid) { |
| 21 | return QtProfileSelectionDialog::tr( | 22 | return QtProfileSelectionDialog::tr( |
| 22 | "%1\n%2", "%1 is the profile username, %2 is the formatted UUID (e.g. " | 23 | "%1\n%2", "%1 is the profile username, %2 is the formatted UUID (e.g. " |
| @@ -41,6 +42,7 @@ QPixmap GetIcon(Common::UUID uuid) { | |||
| 41 | 42 | ||
| 42 | return icon.scaled(64, 64, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); | 43 | return icon.scaled(64, 64, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); |
| 43 | } | 44 | } |
| 45 | } // Anonymous namespace | ||
| 44 | 46 | ||
| 45 | QtProfileSelectionDialog::QtProfileSelectionDialog(QWidget* parent) | 47 | QtProfileSelectionDialog::QtProfileSelectionDialog(QWidget* parent) |
| 46 | : QDialog(parent), profile_manager(std::make_unique<Service::Account::ProfileManager>()) { | 48 | : QDialog(parent), profile_manager(std::make_unique<Service::Account::ProfileManager>()) { |