Commit c398a6dd authored by Richard Gobeille's avatar Richard Gobeille

Duke3d: hook up MicroProfile counters to track the number of event executions

Also lowers MICROPROFILE_MAX_COUNTERS to 256.
parent de49453f
......@@ -177,6 +177,8 @@ typedef uint16_t MicroProfileGroupId;
#define MicroProfileGpuEnd() 0
#define MicroProfileGpuSubmit(w) do{} while(0)
#define MicroProfileCounterAdd(name, count) do{} while(0)
#else
#include "compat.h"
......@@ -531,7 +533,7 @@ struct MicroProfileScopeHandler
}
};
#define MICROPROFILE_MAX_COUNTERS 1024
#define MICROPROFILE_MAX_COUNTERS 256
#define MICROPROFILE_MAX_COUNTER_NAME_CHARS (MICROPROFILE_MAX_COUNTERS*16)
#define MICROPROFILE_MAX_GROUPS 48 //dont bump! no. of bits used it bitmask
......
......@@ -39,6 +39,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#if MICROPROFILE_ENABLED != 0
MicroProfileToken g_eventTokens[MAXEVENTS];
MicroProfileToken g_eventCounterTokens[MAXEVENTS];
MicroProfileToken g_actorTokens[MAXTILES];
MicroProfileToken g_statnumTokens[MAXSTATUS];
#if 0
......@@ -6430,7 +6431,10 @@ void C_Compile(const char *fileName)
for (int i=0; i<MAXEVENTS; i++)
{
if (VM_HaveEvent(i))
g_eventTokens[i] = MicroProfileGetToken("CON VM Events", EventNames[i], MP_AUTO, MicroProfileTokenTypeCpu);
{
g_eventTokens[i] = MicroProfileGetToken("CON VM Events", EventNames[i], MP_AUTO, MicroProfileTokenTypeCpu);
g_eventCounterTokens[i] = MicroProfileGetCounterToken(EventNames[i]);
}
}
#if 0
......
......@@ -45,6 +45,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#if MICROPROFILE_ENABLED != 0
extern MicroProfileToken g_eventTokens[MAXEVENTS];
extern MicroProfileToken g_eventCounterTokens[MAXEVENTS];
extern MicroProfileToken g_actorTokens[MAXTILES];
extern MicroProfileToken g_statnumTokens[MAXSTATUS];
#if 0
......@@ -137,6 +138,7 @@ static FORCE_INLINE int32_t VM_EventInlineInternal__(int const eventNum, int con
int const playerDist = -1, int32_t returnValue = 0)
{
MICROPROFILE_SCOPE_TOKEN(g_eventTokens[eventNum]);
MicroProfileCounterAdd(g_eventCounterTokens[eventNum], 1);
vmstate_t const newVMstate = { spriteNum, playerNum, playerDist, 0,
&sprite[spriteNum&(MAXSPRITES-1)],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment