Skip to content

Commit 615ddba

Browse files
authored
Hide 'Limiter' from framegraph when not needed (PR #3723, Issue #3718)
1 parent 81c939a commit 615ddba

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

Client/core/CCore.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,13 @@ void CCore::RecalculateFrameRateLimit(uint uiServerFrameRateLimit, bool bLogToCo
18691869
if ((m_uiFrameRateLimit == 0 || uiClientScriptRate < m_uiFrameRateLimit) && uiClientScriptRate > 0)
18701870
m_uiFrameRateLimit = uiClientScriptRate;
18711871

1872+
// Removes Limiter from Frame Graph if limit is zero and skips frame limit
1873+
if (m_uiFrameRateLimit == 0)
1874+
{
1875+
m_bQueuedFrameRateValid = false;
1876+
GetGraphStats()->RemoveTimingPoint("Limiter");
1877+
}
1878+
18721879
// Print new limits to the console
18731880
if (bLogToConsole)
18741881
{

Client/core/CGraphStats.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class CGraphStats : public CGraphStatsInterface
3939
virtual void SetEnabled(bool bEnabled);
4040
virtual bool IsEnabled();
4141
virtual void AddTimingPoint(const char* szName);
42+
virtual void RemoveTimingPoint(const char* szName);
4243

4344
protected:
4445
bool m_bEnabled;
@@ -189,6 +190,21 @@ void CGraphStats::AddTimingPoint(const char* szName)
189190
pLine->dataHistory[pLine->iDataPos] = AvgData;
190191
}
191192

193+
///////////////////////////////////////////////////////////////
194+
//
195+
// CGraphStats::RemoveTimingPoint
196+
//
197+
//
198+
//
199+
///////////////////////////////////////////////////////////////
200+
void CGraphStats::RemoveTimingPoint(const char* szName)
201+
{
202+
if (!IsEnabled() || szName[0] == 0)
203+
return;
204+
205+
MapRemove(m_LineList, szName);
206+
}
207+
192208
///////////////////////////////////////////////////////////////
193209
//
194210
// CGraphStats::Draw

Client/core/CGraphStats.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class CGraphStatsInterface
2323
virtual void SetEnabled(bool bEnabled) = 0;
2424
virtual bool IsEnabled() = 0;
2525
virtual void AddTimingPoint(const char* szName) = 0;
26+
virtual void RemoveTimingPoint(const char* szName) = 0;
2627
};
2728

2829
CGraphStatsInterface* GetGraphStats();

0 commit comments

Comments
 (0)