From a99c7d01e1b043df9c09a3047bf0442f88ad94d3 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 10 Jul 2019 23:11:14 -0400 Subject: VideoCommon/Statistics: Normalize statistic variable names Normalizes all variables related to statistics so that they follow our coding style. These are relatively low traffic areas, so this modification isn't too noisy. --- Source/Core/VideoCommon/OpcodeDecoding.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/Core/VideoCommon/OpcodeDecoding.cpp') diff --git a/Source/Core/VideoCommon/OpcodeDecoding.cpp b/Source/Core/VideoCommon/OpcodeDecoding.cpp index 5299401f68..2b3967d646 100644 --- a/Source/Core/VideoCommon/OpcodeDecoding.cpp +++ b/Source/Core/VideoCommon/OpcodeDecoding.cpp @@ -54,7 +54,7 @@ static u32 InterpretDisplayList(u32 address, u32 size) Statistics::SwapDL(); Run(DataReader(startAddress, startAddress + size), &cycles, true); - INCSTAT(stats.thisFrame.numDListsCalled); + INCSTAT(stats.this_frame.num_dlists_called); // un-swap Statistics::SwapDL(); @@ -114,7 +114,7 @@ u8* Run(DataReader src, u32* cycles, bool in_display_list) u32 value = src.Read(); LoadCPReg(sub_cmd, value, is_preprocess); if (!is_preprocess) - INCSTAT(stats.thisFrame.numCPLoads); + INCSTAT(stats.this_frame.num_cp_loads); } break; @@ -132,7 +132,7 @@ u8* Run(DataReader src, u32* cycles, bool in_display_list) u32 xf_address = Cmd2 & 0xFFFF; LoadXFReg(transfer_size, xf_address, src); - INCSTAT(stats.thisFrame.numXFLoads); + INCSTAT(stats.this_frame.num_xf_loads); } src.Skip(transfer_size); } @@ -208,7 +208,7 @@ u8* Run(DataReader src, u32* cycles, bool in_display_list) else { LoadBPReg(bp_cmd); - INCSTAT(stats.thisFrame.numBPLoads); + INCSTAT(stats.this_frame.num_bp_loads); } } break; -- cgit v1.2.3 From 9802a5e16b5860d1c6b42beeb1b8ca883467e1b1 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 10 Jul 2019 23:24:35 -0400 Subject: VideoCommon/Statistics: Make all member functions non-static Rather than making Statistics' member functions operate on the global variable instance of itself, we can make these functions member functions and operate on a by-instance state, removing the direct dependency on the global variable itself. This also makes for less reading, as there's no need to repeat "stats." for all variable accesses. --- Source/Core/VideoCommon/OpcodeDecoding.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoCommon/OpcodeDecoding.cpp') diff --git a/Source/Core/VideoCommon/OpcodeDecoding.cpp b/Source/Core/VideoCommon/OpcodeDecoding.cpp index 2b3967d646..a93fba7258 100644 --- a/Source/Core/VideoCommon/OpcodeDecoding.cpp +++ b/Source/Core/VideoCommon/OpcodeDecoding.cpp @@ -51,13 +51,13 @@ static u32 InterpretDisplayList(u32 address, u32 size) if (startAddress != nullptr) { // temporarily swap dl and non-dl (small "hack" for the stats) - Statistics::SwapDL(); + stats.SwapDL(); Run(DataReader(startAddress, startAddress + size), &cycles, true); INCSTAT(stats.this_frame.num_dlists_called); // un-swap - Statistics::SwapDL(); + stats.SwapDL(); } return cycles; -- cgit v1.2.3 From d4337eebdeb999df380394cdd20d054f5e9fe375 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 10 Jul 2019 23:34:50 -0400 Subject: VideoCommon/Statistics: Rename stats global to g_stats Makes the global variable follow our convention of prefixing g_ on global variables to make it obvious in surrounding code that it's not a local variable. --- Source/Core/VideoCommon/OpcodeDecoding.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Source/Core/VideoCommon/OpcodeDecoding.cpp') diff --git a/Source/Core/VideoCommon/OpcodeDecoding.cpp b/Source/Core/VideoCommon/OpcodeDecoding.cpp index a93fba7258..2e40b6d863 100644 --- a/Source/Core/VideoCommon/OpcodeDecoding.cpp +++ b/Source/Core/VideoCommon/OpcodeDecoding.cpp @@ -51,13 +51,13 @@ static u32 InterpretDisplayList(u32 address, u32 size) if (startAddress != nullptr) { // temporarily swap dl and non-dl (small "hack" for the stats) - stats.SwapDL(); + g_stats.SwapDL(); Run(DataReader(startAddress, startAddress + size), &cycles, true); - INCSTAT(stats.this_frame.num_dlists_called); + INCSTAT(g_stats.this_frame.num_dlists_called); // un-swap - stats.SwapDL(); + g_stats.SwapDL(); } return cycles; @@ -114,7 +114,7 @@ u8* Run(DataReader src, u32* cycles, bool in_display_list) u32 value = src.Read(); LoadCPReg(sub_cmd, value, is_preprocess); if (!is_preprocess) - INCSTAT(stats.this_frame.num_cp_loads); + INCSTAT(g_stats.this_frame.num_cp_loads); } break; @@ -132,7 +132,7 @@ u8* Run(DataReader src, u32* cycles, bool in_display_list) u32 xf_address = Cmd2 & 0xFFFF; LoadXFReg(transfer_size, xf_address, src); - INCSTAT(stats.this_frame.num_xf_loads); + INCSTAT(g_stats.this_frame.num_xf_loads); } src.Skip(transfer_size); } @@ -208,7 +208,7 @@ u8* Run(DataReader src, u32* cycles, bool in_display_list) else { LoadBPReg(bp_cmd); - INCSTAT(stats.this_frame.num_bp_loads); + INCSTAT(g_stats.this_frame.num_bp_loads); } } break; -- cgit v1.2.3