summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-07-10 23:34:50 -0400
committerLioncash <mathew1800@gmail.com>2019-07-10 23:34:54 -0400
commitd4337eebdeb999df380394cdd20d054f5e9fe375 (patch)
treeb2c04979677aa138cbc3202c510a96040ba9adcd /Source/Core/VideoCommon
parent9802a5e16b5860d1c6b42beeb1b8ca883467e1b1 (diff)
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.
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/AsyncRequests.cpp8
-rw-r--r--Source/Core/VideoCommon/OpcodeDecoding.cpp12
-rw-r--r--Source/Core/VideoCommon/RenderBase.cpp10
-rw-r--r--Source/Core/VideoCommon/ShaderCache.cpp32
-rw-r--r--Source/Core/VideoCommon/Statistics.cpp2
-rw-r--r--Source/Core/VideoCommon/Statistics.h2
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp10
-rw-r--r--Source/Core/VideoCommon/VertexLoaderManager.cpp8
-rw-r--r--Source/Core/VideoCommon/VertexManagerBase.cpp2
-rw-r--r--Source/Core/VideoCommon/VertexShaderManager.cpp6
10 files changed, 46 insertions, 46 deletions
diff --git a/Source/Core/VideoCommon/AsyncRequests.cpp b/Source/Core/VideoCommon/AsyncRequests.cpp
index 5df1e9e4ef..11a37afdfa 100644
--- a/Source/Core/VideoCommon/AsyncRequests.cpp
+++ b/Source/Core/VideoCommon/AsyncRequests.cpp
@@ -117,7 +117,7 @@ void AsyncRequests::HandleEvent(const AsyncRequests::Event& e)
{
case Event::EFB_POKE_COLOR:
{
- INCSTAT(stats.this_frame.num_efb_pokes);
+ INCSTAT(g_stats.this_frame.num_efb_pokes);
EfbPokeData poke = {e.efb_poke.x, e.efb_poke.y, e.efb_poke.data};
g_renderer->PokeEFB(EFBAccessType::PokeColor, &poke, 1);
}
@@ -125,20 +125,20 @@ void AsyncRequests::HandleEvent(const AsyncRequests::Event& e)
case Event::EFB_POKE_Z:
{
- INCSTAT(stats.this_frame.num_efb_pokes);
+ INCSTAT(g_stats.this_frame.num_efb_pokes);
EfbPokeData poke = {e.efb_poke.x, e.efb_poke.y, e.efb_poke.data};
g_renderer->PokeEFB(EFBAccessType::PokeZ, &poke, 1);
}
break;
case Event::EFB_PEEK_COLOR:
- INCSTAT(stats.this_frame.num_efb_peeks);
+ INCSTAT(g_stats.this_frame.num_efb_peeks);
*e.efb_peek.data =
g_renderer->AccessEFB(EFBAccessType::PeekColor, e.efb_peek.x, e.efb_peek.y, 0);
break;
case Event::EFB_PEEK_Z:
- INCSTAT(stats.this_frame.num_efb_peeks);
+ INCSTAT(g_stats.this_frame.num_efb_peeks);
*e.efb_peek.data = g_renderer->AccessEFB(EFBAccessType::PeekZ, e.efb_peek.x, e.efb_peek.y, 0);
break;
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<u32>();
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<u32>(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;
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp
index 06471c8560..795a96e40d 100644
--- a/Source/Core/VideoCommon/RenderBase.cpp
+++ b/Source/Core/VideoCommon/RenderBase.cpp
@@ -524,7 +524,7 @@ void Renderer::DrawDebugText()
}
if (g_ActiveConfig.bOverlayStats)
- stats.Display();
+ g_stats.Display();
if (g_ActiveConfig.bShowNetPlayMessages && g_netplay_chat_ui)
g_netplay_chat_ui->Display();
@@ -533,7 +533,7 @@ void Renderer::DrawDebugText()
g_netplay_golf_ui->Display();
if (g_ActiveConfig.bOverlayProjStats)
- stats.DisplayProj();
+ g_stats.DisplayProj();
}
float Renderer::CalculateDrawAspectRatio() const
@@ -1280,8 +1280,8 @@ void Renderer::Swap(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height, u6
DolphinAnalytics::PerformanceSample perf_sample;
perf_sample.speed_ratio = SystemTimers::GetEstimatedEmulationPerformance();
- perf_sample.num_prims = stats.this_frame.num_prims + stats.this_frame.num_dl_prims;
- perf_sample.num_draw_calls = stats.this_frame.num_draw_calls;
+ perf_sample.num_prims = g_stats.this_frame.num_prims + g_stats.this_frame.num_dl_prims;
+ perf_sample.num_draw_calls = g_stats.this_frame.num_draw_calls;
DolphinAnalytics::Instance().ReportPerformanceInfo(std::move(perf_sample));
if (IsFrameDumping())
@@ -1289,7 +1289,7 @@ void Renderer::Swap(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height, u6
// Begin new frame
m_frame_count++;
- stats.ResetFrame();
+ g_stats.ResetFrame();
g_shader_cache->RetrieveAsyncShaders();
g_vertex_manager->OnEndFrame();
BeginImGuiFrame();
diff --git a/Source/Core/VideoCommon/ShaderCache.cpp b/Source/Core/VideoCommon/ShaderCache.cpp
index 649b5a8587..1f578f6bd8 100644
--- a/Source/Core/VideoCommon/ShaderCache.cpp
+++ b/Source/Core/VideoCommon/ShaderCache.cpp
@@ -221,12 +221,12 @@ void ShaderCache::LoadShaderCache(T& cache, APIType api_type, const char* type,
switch (stage)
{
case ShaderStage::Vertex:
- INCSTAT(stats.num_vertex_shaders_created);
- INCSTAT(stats.num_vertex_shaders_alive);
+ INCSTAT(g_stats.num_vertex_shaders_created);
+ INCSTAT(g_stats.num_vertex_shaders_alive);
break;
case ShaderStage::Pixel:
- INCSTAT(stats.num_pixel_shaders_created);
- INCSTAT(stats.num_pixel_shaders_alive);
+ INCSTAT(g_stats.num_pixel_shaders_created);
+ INCSTAT(g_stats.num_pixel_shaders_alive);
break;
default:
break;
@@ -369,10 +369,10 @@ void ShaderCache::ClearCaches()
ClearShaderCache(m_uber_vs_cache);
ClearShaderCache(m_uber_ps_cache);
- SETSTAT(stats.num_pixel_shaders_created, 0);
- SETSTAT(stats.num_pixel_shaders_alive, 0);
- SETSTAT(stats.num_vertex_shaders_created, 0);
- SETSTAT(stats.num_vertex_shaders_alive, 0);
+ SETSTAT(g_stats.num_pixel_shaders_created, 0);
+ SETSTAT(g_stats.num_pixel_shaders_alive, 0);
+ SETSTAT(g_stats.num_vertex_shaders_created, 0);
+ SETSTAT(g_stats.num_vertex_shaders_alive, 0);
}
void ShaderCache::CompileMissingPipelines()
@@ -434,8 +434,8 @@ const AbstractShader* ShaderCache::InsertVertexShader(const VertexShaderUid& uid
if (!binary.empty())
m_vs_cache.disk_cache.Append(uid, binary.data(), static_cast<u32>(binary.size()));
}
- INCSTAT(stats.num_vertex_shaders_created);
- INCSTAT(stats.num_vertex_shaders_alive);
+ INCSTAT(g_stats.num_vertex_shaders_created);
+ INCSTAT(g_stats.num_vertex_shaders_alive);
entry.shader = std::move(shader);
}
@@ -456,8 +456,8 @@ const AbstractShader* ShaderCache::InsertVertexUberShader(const UberShader::Vert
if (!binary.empty())
m_uber_vs_cache.disk_cache.Append(uid, binary.data(), static_cast<u32>(binary.size()));
}
- INCSTAT(stats.num_vertex_shaders_created);
- INCSTAT(stats.num_vertex_shaders_alive);
+ INCSTAT(g_stats.num_vertex_shaders_created);
+ INCSTAT(g_stats.num_vertex_shaders_alive);
entry.shader = std::move(shader);
}
@@ -478,8 +478,8 @@ const AbstractShader* ShaderCache::InsertPixelShader(const PixelShaderUid& uid,
if (!binary.empty())
m_ps_cache.disk_cache.Append(uid, binary.data(), static_cast<u32>(binary.size()));
}
- INCSTAT(stats.num_pixel_shaders_created);
- INCSTAT(stats.num_pixel_shaders_alive);
+ INCSTAT(g_stats.num_pixel_shaders_created);
+ INCSTAT(g_stats.num_pixel_shaders_alive);
entry.shader = std::move(shader);
}
@@ -500,8 +500,8 @@ const AbstractShader* ShaderCache::InsertPixelUberShader(const UberShader::Pixel
if (!binary.empty())
m_uber_ps_cache.disk_cache.Append(uid, binary.data(), static_cast<u32>(binary.size()));
}
- INCSTAT(stats.num_pixel_shaders_created);
- INCSTAT(stats.num_pixel_shaders_alive);
+ INCSTAT(g_stats.num_pixel_shaders_created);
+ INCSTAT(g_stats.num_pixel_shaders_alive);
entry.shader = std::move(shader);
}
diff --git a/Source/Core/VideoCommon/Statistics.cpp b/Source/Core/VideoCommon/Statistics.cpp
index 081e20353c..98b60dd5da 100644
--- a/Source/Core/VideoCommon/Statistics.cpp
+++ b/Source/Core/VideoCommon/Statistics.cpp
@@ -10,7 +10,7 @@
#include "VideoCommon/VideoConfig.h"
-Statistics stats;
+Statistics g_stats;
void Statistics::ResetFrame()
{
diff --git a/Source/Core/VideoCommon/Statistics.h b/Source/Core/VideoCommon/Statistics.h
index 8491010641..e6fa72616a 100644
--- a/Source/Core/VideoCommon/Statistics.h
+++ b/Source/Core/VideoCommon/Statistics.h
@@ -67,7 +67,7 @@ struct Statistics
void DisplayProj() const;
};
-extern Statistics stats;
+extern Statistics g_stats;
#define STATISTICS
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp
index d031792b4b..490b51683e 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/TextureCacheBase.cpp
@@ -1200,8 +1200,8 @@ TextureCacheBase::GetTexture(u32 address, u32 width, u32 height, const TextureFo
}
}
- INCSTAT(stats.num_textures_uploaded);
- SETSTAT(stats.num_textures_alive, static_cast<int>(textures_by_address.size()));
+ INCSTAT(g_stats.num_textures_uploaded);
+ SETSTAT(g_stats.num_textures_alive, static_cast<int>(textures_by_address.size()));
entry = DoPartialTextureUpdates(iter->second, &texMem[tlutaddr], tlutfmt);
@@ -1277,8 +1277,8 @@ TextureCacheBase::GetXFBTexture(u32 address, u32 width, u32 height, u32 stride,
// Insert into the texture cache so we can re-use it next frame, if needed.
textures_by_address.emplace(entry->addr, entry);
- SETSTAT(stats.num_textures_alive, static_cast<int>(textures_by_address.size()));
- INCSTAT(stats.num_textures_uploaded);
+ SETSTAT(g_stats.num_textures_alive, static_cast<int>(textures_by_address.size()));
+ INCSTAT(g_stats.num_textures_uploaded);
if (g_ActiveConfig.bDumpXFBTarget)
{
@@ -2017,7 +2017,7 @@ TextureCacheBase::AllocateTexture(const TextureConfig& config)
}
}
- INCSTAT(stats.num_textures_created);
+ INCSTAT(g_stats.num_textures_created);
return TexPoolEntry(std::move(texture), std::move(framebuffer));
}
diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp
index 391d956401..81b537c297 100644
--- a/Source/Core/VideoCommon/VertexLoaderManager.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp
@@ -54,7 +54,7 @@ void Init()
map_entry = nullptr;
for (auto& map_entry : g_preprocess_cp_state.vertex_loaders)
map_entry = nullptr;
- SETSTAT(stats.num_vertex_loaders, 0);
+ SETSTAT(g_stats.num_vertex_loaders, 0);
}
void Clear()
@@ -223,7 +223,7 @@ static VertexLoaderBase* RefreshLoader(int vtx_attr_group, bool preprocess = fal
s_vertex_loader_map[uid] =
VertexLoaderBase::CreateVertexLoader(state->vtx_desc, state->vtx_attr[vtx_attr_group]);
loader = s_vertex_loader_map[uid].get();
- INCSTAT(stats.num_vertex_loaders);
+ INCSTAT(g_stats.num_vertex_loaders);
}
if (check_for_native_format)
{
@@ -287,8 +287,8 @@ int RunVertices(int vtx_attr_group, int primitive, int count, DataReader src, bo
g_vertex_manager->FlushData(count, loader->m_native_vtx_decl.stride);
- ADDSTAT(stats.this_frame.num_prims, count);
- INCSTAT(stats.this_frame.num_primitive_joins);
+ ADDSTAT(g_stats.this_frame.num_prims, count);
+ INCSTAT(g_stats.this_frame.num_primitive_joins);
return size;
}
diff --git a/Source/Core/VideoCommon/VertexManagerBase.cpp b/Source/Core/VideoCommon/VertexManagerBase.cpp
index f196bfc48a..c9fa12f6bb 100644
--- a/Source/Core/VideoCommon/VertexManagerBase.cpp
+++ b/Source/Core/VideoCommon/VertexManagerBase.cpp
@@ -442,7 +442,7 @@ void VertexManagerBase::Flush()
g_perf_query->EnableQuery(bpmem.zcontrol.early_ztest ? PQG_ZCOMP_ZCOMPLOC : PQG_ZCOMP);
DrawCurrentBatch(base_index, num_indices, base_vertex);
- INCSTAT(stats.this_frame.num_draw_calls);
+ INCSTAT(g_stats.this_frame.num_draw_calls);
if (PerfQueryBase::ShouldEmulate())
g_perf_query->DisableQuery(bpmem.zcontrol.early_ztest ? PQG_ZCOMP_ZCOMPLOC : PQG_ZCOMP);
diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp
index 2cfc19993f..59a89be52d 100644
--- a/Source/Core/VideoCommon/VertexShaderManager.cpp
+++ b/Source/Core/VideoCommon/VertexShaderManager.cpp
@@ -374,7 +374,7 @@ void VertexShaderManager::SetConstants()
g_fProjectionMatrix[14] = -1.0f;
g_fProjectionMatrix[15] = 0.0f;
- stats.gproj = g_fProjectionMatrix;
+ g_stats.gproj = g_fProjectionMatrix;
break;
case GX_ORTHOGRAPHIC:
@@ -399,8 +399,8 @@ void VertexShaderManager::SetConstants()
g_fProjectionMatrix[14] = 0.0f;
g_fProjectionMatrix[15] = 1.0f;
- stats.g2proj = g_fProjectionMatrix;
- stats.proj = rawProjection;
+ g_stats.g2proj = g_fProjectionMatrix;
+ g_stats.proj = rawProjection;
break;
default: