Skip to content

Commit

Permalink
Budgeting
Browse files Browse the repository at this point in the history
Trying to find some of the unaccounted performance loss.
  • Loading branch information
shokunin000 committed Apr 3, 2016
1 parent 69b6161 commit 7a0b4c1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions game/client/worldlight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ void CWorldLights::LevelInitPreEntity()
//-----------------------------------------------------------------------------
bool CWorldLights::GetBrightestLightSource(const Vector &vecPosition, Vector &vecLightPos, Vector &vecLightBrightness)
{
VPROF_BUDGET( "CWorldLights::GetBrightestLightSource", VPROF_BUDGETGROUP_SHADOW_RENDERING );

if ( !m_nWorldLights || !m_pWorldLights )
return false;

Expand Down
7 changes: 7 additions & 0 deletions game/server/modelentities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "entityoutput.h"
#include "ndebugoverlay.h"
#include "modelentities.h"
#include "tier0/vprof.h"

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
Expand Down Expand Up @@ -453,6 +454,8 @@ void CFuncBrushGlow::InputEmitEnergy( inputdata_t &inputdata )
//-----------------------------------------------------------------------------
void CFuncBrushGlow::UpdateThink( void )
{
VPROF_BUDGET( "CVisibleShadowList::GlowCalc", VPROF_BUDGETGROUP_GLOWCALC );

float fCurrentEnergy = m_Energy.Get();

if ( m_bAbsorbing && fCurrentEnergy < 1.0f )
Expand Down Expand Up @@ -488,6 +491,8 @@ void CFuncBrushGlow::UpdateThink( void )
//-----------------------------------------------------------------------------
void CFuncBrushGlow::IllumThink( void )
{
VPROF_BUDGET( "CVisibleShadowList::IllumThink", VPROF_BUDGETGROUP_GLOWCALC );

if ( ( UTIL_FindClientInPVS( edict() ) != NULL ) || ( UTIL_ClientPVSIsExpanded() && UTIL_FindClientInVisibilityPVS( edict() ) ) )
{
CheckIlluminated();
Expand All @@ -504,6 +509,8 @@ void CFuncBrushGlow::IllumThink( void )

void CFuncBrushGlow::CheckIlluminated()
{
VPROF_BUDGET( "CVisibleShadowList::CheckIlluminated", VPROF_BUDGETGROUP_GLOWCALC );

// If we're being illuminated by the flashlight send output
CBasePlayer *pPlayer = AI_GetSinglePlayer();
if ( pPlayer )
Expand Down
4 changes: 3 additions & 1 deletion public/tier0/vprof.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@
#define VPROF_BUDGETGROUP_TENFOOT VPROF_BUDGETGROUP_CHROMEHTML
#define VPROF_BUDGETGROUP_STEAMUI VPROF_BUDGETGROUP_CHROMEHTML
#define VPROF_BUDGETGROUP_ATTRIBUTES _T("Attributes")

#define VPROF_BUDGETGROUP_SETUPVIEWS _T("SetupViews")
#define VPROF_BUDGETGROUP_GLOWCALC _T("GlowCalc")

#ifdef _X360
// update flags
#define VPROF_UPDATE_BUDGET 0x01 // send budget data every frame
Expand Down

0 comments on commit 7a0b4c1

Please sign in to comment.