Skip to content

Commit cc13f31

Browse files
author
nitrocaster
committed
Dump additional xrXRC statistics.
1 parent d6fb874 commit cc13f31

File tree

14 files changed

+50
-41
lines changed

14 files changed

+50
-41
lines changed

src/Layers/xrRender/DetailManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ void CDetailManager::SSwingValue::lerp(const SSwingValue& A, const SSwingValue&
7373
//////////////////////////////////////////////////////////////////////
7474
// Construction/Destruction
7575
//////////////////////////////////////////////////////////////////////
76-
77-
CDetailManager::CDetailManager ()
76+
// XXX stats: add to statistics
77+
CDetailManager::CDetailManager () : xrc("detail manager")
7878
{
7979
dtFS = 0;
8080
dtSlots = 0;

src/Layers/xrRender/HOM.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void __stdcall CHOM::MT_RENDER()
2828
// Construction/Destruction
2929
//////////////////////////////////////////////////////////////////////
3030

31-
CHOM::CHOM()
31+
CHOM::CHOM() : xrc("HOM")
3232
{
3333
bEnabled = FALSE;
3434
m_pModel = 0;
@@ -341,6 +341,7 @@ void CHOM::DumpStatistics(IGameFont &font, IPerformanceAlert *alert)
341341
font.OutNext("- frustum: %u", stats.FrustumTriangleCount);
342342
font.OutNext("- total: %d", m_pModel ? m_pModel->get_tris_count() : 0);
343343
stats.FrameStart();
344+
xrc.DumpStatistics(font, alert);
344345
}
345346

346347
#ifdef DEBUG

src/Layers/xrRender/WallmarksEngine.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ CWallmarksEngine::wm_slot* CWallmarksEngine::AppendSlot (ref_shader shader)
4545
// Construction/Destruction
4646
//////////////////////////////////////////////////////////////////////
4747

48-
CWallmarksEngine::CWallmarksEngine ()
48+
CWallmarksEngine::CWallmarksEngine () :
4949
#ifdef CONFIG_PROFILE_LOCKS
50-
:lock(MUTEX_PROFILE_ID(CWallmarksEngine))
50+
lock(MUTEX_PROFILE_ID(CWallmarksEngine)),
5151
#endif // CONFIG_PROFILE_LOCKS
52+
xrc("wallmarks") // XXX stats: add to statistics
5253
{
5354
static_pool.reserve (256);
5455
marks.reserve (256);

src/Layers/xrRenderPC_R1/FStaticRender.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ IC void gm_SetNearer (BOOL bNearer)
317317
// Construction/Destruction
318318
//////////////////////////////////////////////////////////////////////
319319
CRender::CRender ()
320-
:m_bFirstFrameAfterReset(false)
320+
:m_bFirstFrameAfterReset(false), Sectors_xrc("render")
321321
{
322322
}
323323

@@ -655,6 +655,7 @@ void CRender::DumpStatistics(IGameFont &font, IPerformanceAlert *alert)
655655
{
656656
D3DXRenderBase::DumpStatistics(font, alert);
657657
HOM.DumpStatistics(font, alert);
658+
Sectors_xrc.DumpStatistics(font, alert);
658659
}
659660

660661
#pragma comment(lib,"d3dx9.lib")

src/Layers/xrRenderPC_R1/LightPPA.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ void CLightR_Manager::add (light* L)
333333
}
334334
VERIFY (L->spatial.sector);
335335
}
336-
337-
CLightR_Manager::CLightR_Manager ()
336+
// XXX stats: add to statistics
337+
CLightR_Manager::CLightR_Manager () : xrc("LightR_Manager")
338338
{
339339
}
340340

src/Layers/xrRenderPC_R1/LightShadows.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ const u32 cache_old = 30*1000; // 30 secs
3131
//////////////////////////////////////////////////////////////////////
3232
// Construction/Destruction
3333
//////////////////////////////////////////////////////////////////////
34-
35-
CLightShadows::CLightShadows()
34+
// XXX: add to statistics
35+
CLightShadows::CLightShadows() : xrc("LightShadows")
3636
{
3737
current = 0;
3838
RT = 0;

src/Layers/xrRenderPC_R2/r2.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ void CRender::rmNormal ()
515515
// Construction/Destruction
516516
//////////////////////////////////////////////////////////////////////
517517
CRender::CRender()
518-
:m_bFirstFrameAfterReset(false)
518+
:m_bFirstFrameAfterReset(false), Sectors_xrc("render")
519519
{
520520
init_cacades();
521521
}
@@ -543,6 +543,7 @@ void CRender::DumpStatistics(IGameFont &font, IPerformanceAlert *alert)
543543
font.OutNext("- culled: %u", Stats.ic_culled);
544544
Stats.FrameStart();
545545
HOM.DumpStatistics(font, alert);
546+
Sectors_xrc.DumpStatistics(font, alert);
546547
}
547548

548549
/////////

src/Layers/xrRenderPC_R3/r3.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ void CRender::rmNormal ()
648648
// Construction/Destruction
649649
//////////////////////////////////////////////////////////////////////
650650
CRender::CRender()
651-
:m_bFirstFrameAfterReset(false)
651+
:m_bFirstFrameAfterReset(false), Sectors_xrc("render")
652652
{
653653
init_cacades();
654654
}
@@ -676,6 +676,7 @@ void CRender::DumpStatistics(IGameFont &font, IPerformanceAlert *alert)
676676
font.OutNext("- culled: %u", Stats.ic_culled);
677677
Stats.FrameStart();
678678
HOM.DumpStatistics(font, alert);
679+
Sectors_xrc.DumpStatistics(font, alert);
679680
}
680681

681682
static inline bool match_shader_id ( LPCSTR const debug_shader_id, LPCSTR const full_shader_id, FS_FileSet const& file_set, string_path& result );

src/Layers/xrRenderPC_R4/r4.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ void CRender::rmNormal ()
662662
// Construction/Destruction
663663
//////////////////////////////////////////////////////////////////////
664664
CRender::CRender()
665-
:m_bFirstFrameAfterReset(false)
665+
:m_bFirstFrameAfterReset(false), Sectors_xrc("render")
666666
{
667667
init_cacades();
668668
}
@@ -690,6 +690,7 @@ void CRender::DumpStatistics(IGameFont &font, IPerformanceAlert *alert)
690690
font.OutNext("- culled: %u", Stats.ic_culled);
691691
Stats.FrameStart();
692692
HOM.DumpStatistics(font, alert);
693+
Sectors_xrc.DumpStatistics(font, alert);
693694
}
694695

695696
/////////

src/xrCDB/xrXRC.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44

55
#include "stdafx.h"
66
#include "xrXRC.h"
7+
#include "xrEngine/IGameFont.hpp"
8+
#include "xrEngine/IPerformanceAlert.hpp"
79

8-
XRCDB_API xrXRC XRC;
10+
XRCDB_API xrXRC XRC("global");
911

10-
xrXRC::xrXRC()
12+
void xrXRC::DumpStatistics(IGameFont &font, IPerformanceAlert *alert)
1113
{
12-
13-
}
14-
15-
xrXRC::~xrXRC()
16-
{
17-
14+
Stats.FrameEnd();
15+
font.OutNext("XRC (%s):", name);
16+
font.OutNext("- ray: %2.2fms, %d, %2.0fK", Stats.RayQuery.result, Stats.RayQuery.count, Stats.RayPs);
17+
font.OutNext("- box: %2.2fms, %d, %2.0fK", Stats.BoxQuery.result, Stats.BoxQuery.count, Stats.BoxPs);
18+
font.OutNext("- frustum: %2.2fms, %d", Stats.FrustumQuery.result, Stats.FrustumQuery.count);
19+
Stats.FrameStart();
1820
}

0 commit comments

Comments
 (0)