summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2014-06-29 16:41:54 -0400
committerLioncash <mathew1800@gmail.com>2014-06-29 16:41:54 -0400
commitd720e3ed0be9b897e1b87d0cc04831e573617df2 (patch)
treec3da7fd7cf4138655a9a1f1b13a651e1a4cc6d1b /Source/Core
parent933358a28c3a96b9b951481cf99a71fd2b68c280 (diff)
parent7db5a4b22db6cc7cea987a38d1d8ce9b0a594394 (diff)
Merge pull request #452 from degasus/stats
Video statistics update
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/VideoBackends/D3D/VertexManager.cpp6
-rw-r--r--Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp1
-rw-r--r--Source/Core/VideoBackends/OGL/VertexManager.cpp2
-rw-r--r--Source/Core/VideoCommon/OpcodeDecoding.cpp1
-rw-r--r--Source/Core/VideoCommon/Statistics.cpp44
-rw-r--r--Source/Core/VideoCommon/Statistics.h12
6 files changed, 25 insertions, 41 deletions
diff --git a/Source/Core/VideoBackends/D3D/VertexManager.cpp b/Source/Core/VideoBackends/D3D/VertexManager.cpp
index 71e7d72b99..00e32ed871 100644
--- a/Source/Core/VideoBackends/D3D/VertexManager.cpp
+++ b/Source/Core/VideoBackends/D3D/VertexManager.cpp
@@ -145,7 +145,7 @@ void VertexManager::Draw(UINT stride)
{
D3D::context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
D3D::context->DrawIndexed(IndexGenerator::GetIndexLen(), m_index_draw_offset, 0);
- INCSTAT(stats.thisFrame.numIndexedDrawCalls);
+ INCSTAT(stats.thisFrame.numDrawCalls);
}
else if (current_primitive_type == PRIMITIVE_LINES)
{
@@ -165,7 +165,7 @@ void VertexManager::Draw(UINT stride)
((DX11::Renderer*)g_renderer)->ApplyCullDisable(); // Disable culling for lines and points
D3D::context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_LINELIST);
D3D::context->DrawIndexed(IndexGenerator::GetIndexLen(), m_index_draw_offset, 0);
- INCSTAT(stats.thisFrame.numIndexedDrawCalls);
+ INCSTAT(stats.thisFrame.numDrawCalls);
D3D::context->GSSetShader(nullptr, nullptr, 0);
((DX11::Renderer*)g_renderer)->RestoreCull();
@@ -189,7 +189,7 @@ void VertexManager::Draw(UINT stride)
((DX11::Renderer*)g_renderer)->ApplyCullDisable(); // Disable culling for lines and points
D3D::context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_POINTLIST);
D3D::context->DrawIndexed(IndexGenerator::GetIndexLen(), m_index_draw_offset, 0);
- INCSTAT(stats.thisFrame.numIndexedDrawCalls);
+ INCSTAT(stats.thisFrame.numDrawCalls);
D3D::context->GSSetShader(nullptr, nullptr, 0);
((DX11::Renderer*)g_renderer)->RestoreCull();
diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp
index b1499c791a..c4c8f7c888 100644
--- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp
+++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp
@@ -123,6 +123,7 @@ void SHADER::Bind()
{
if (CurrentProgram != glprogid)
{
+ INCSTAT(stats.thisFrame.numShaderChanges);
glUseProgram(glprogid);
CurrentProgram = glprogid;
}
diff --git a/Source/Core/VideoBackends/OGL/VertexManager.cpp b/Source/Core/VideoBackends/OGL/VertexManager.cpp
index b32c6adadd..1f3194a6fd 100644
--- a/Source/Core/VideoBackends/OGL/VertexManager.cpp
+++ b/Source/Core/VideoBackends/OGL/VertexManager.cpp
@@ -124,7 +124,7 @@ void VertexManager::Draw(u32 stride)
} else {
glDrawRangeElements(primitive_mode, 0, max_index, index_size, GL_UNSIGNED_SHORT, (u8*)nullptr+s_index_offset);
}
- INCSTAT(stats.thisFrame.numIndexedDrawCalls);
+ INCSTAT(stats.thisFrame.numDrawCalls);
}
void VertexManager::vFlush(bool useDstAlpha)
diff --git a/Source/Core/VideoCommon/OpcodeDecoding.cpp b/Source/Core/VideoCommon/OpcodeDecoding.cpp
index 9575563c7c..5370c35750 100644
--- a/Source/Core/VideoCommon/OpcodeDecoding.cpp
+++ b/Source/Core/VideoCommon/OpcodeDecoding.cpp
@@ -97,7 +97,6 @@ void InterpretDisplayList(u32 address, u32 size)
{
Decode();
}
- INCSTAT(stats.numDListsCalled);
INCSTAT(stats.thisFrame.numDListsCalled);
// un-swap
diff --git a/Source/Core/VideoCommon/Statistics.cpp b/Source/Core/VideoCommon/Statistics.cpp
index 303972fc90..9857c7c39d 100644
--- a/Source/Core/VideoCommon/Statistics.cpp
+++ b/Source/Core/VideoCommon/Statistics.cpp
@@ -27,32 +27,28 @@ void Statistics::SwapDL()
std::string Statistics::ToString()
{
std::string str;
- str += StringFromFormat("Textures created: %i\n",stats.numTexturesCreated);
+ str += StringFromFormat("Textures created: %i\n", stats.numTexturesCreated);
str += StringFromFormat("Textures alive: %i\n", stats.numTexturesAlive);
str += StringFromFormat("pshaders created: %i\n", stats.numPixelShadersCreated);
- str += StringFromFormat("pshaders alive: %i\n",stats.numPixelShadersAlive);
- str += StringFromFormat("pshaders (unique, delete cache first): %i\n",stats.numUniquePixelShaders);
- str += StringFromFormat("vshaders created: %i\n",stats.numVertexShadersCreated);
- str += StringFromFormat("vshaders alive: %i\n",stats.numVertexShadersAlive);
- str += StringFromFormat("dlists called: %i\n",stats.numDListsCalled);
- str += StringFromFormat("dlists called(f): %i\n",stats.thisFrame.numDListsCalled);
- str += StringFromFormat("dlists alive: %i\n",stats.numDListsAlive);
- str += StringFromFormat("Primitive joins: %i\n",stats.thisFrame.numPrimitiveJoins);
- str += StringFromFormat("Draw calls: %i\n",stats.thisFrame.numDrawCalls);
- str += StringFromFormat("Indexed draw calls: %i\n",stats.thisFrame.numIndexedDrawCalls);
- str += StringFromFormat("Buffer splits: %i\n",stats.thisFrame.numBufferSplits);
- str += StringFromFormat("Primitives: %i\n",stats.thisFrame.numPrims);
- str += StringFromFormat("Primitives (DL): %i\n",stats.thisFrame.numDLPrims);
- str += StringFromFormat("XF loads: %i\n",stats.thisFrame.numXFLoads);
- str += StringFromFormat("XF loads (DL): %i\n",stats.thisFrame.numXFLoadsInDL);
- str += StringFromFormat("CP loads: %i\n",stats.thisFrame.numCPLoads);
- str += StringFromFormat("CP loads (DL): %i\n",stats.thisFrame.numCPLoadsInDL);
- str += StringFromFormat("BP loads: %i\n",stats.thisFrame.numBPLoads);
- str += StringFromFormat("BP loads (DL): %i\n",stats.thisFrame.numBPLoadsInDL);
- str += StringFromFormat("Vertex streamed: %i kB\n",stats.thisFrame.bytesVertexStreamed/1024);
- str += StringFromFormat("Index streamed: %i kB\n",stats.thisFrame.bytesIndexStreamed/1024);
- str += StringFromFormat("Uniform streamed: %i kB\n",stats.thisFrame.bytesUniformStreamed/1024);
- str += StringFromFormat("Vertex Loaders: %i\n",stats.numVertexLoaders);
+ str += StringFromFormat("pshaders alive: %i\n", stats.numPixelShadersAlive);
+ str += StringFromFormat("vshaders created: %i\n", stats.numVertexShadersCreated);
+ str += StringFromFormat("vshaders alive: %i\n", stats.numVertexShadersAlive);
+ str += StringFromFormat("shaders changes: %i\n", stats.thisFrame.numShaderChanges);
+ str += StringFromFormat("dlists called: %i\n", stats.thisFrame.numDListsCalled);
+ str += StringFromFormat("Primitive joins: %i\n", stats.thisFrame.numPrimitiveJoins);
+ str += StringFromFormat("Draw calls: %i\n", stats.thisFrame.numDrawCalls);
+ str += StringFromFormat("Primitives: %i\n", stats.thisFrame.numPrims);
+ str += StringFromFormat("Primitives (DL): %i\n", stats.thisFrame.numDLPrims);
+ str += StringFromFormat("XF loads: %i\n", stats.thisFrame.numXFLoads);
+ str += StringFromFormat("XF loads (DL): %i\n", stats.thisFrame.numXFLoadsInDL);
+ str += StringFromFormat("CP loads: %i\n", stats.thisFrame.numCPLoads);
+ str += StringFromFormat("CP loads (DL): %i\n", stats.thisFrame.numCPLoadsInDL);
+ str += StringFromFormat("BP loads: %i\n", stats.thisFrame.numBPLoads);
+ str += StringFromFormat("BP loads (DL): %i\n", stats.thisFrame.numBPLoadsInDL);
+ str += StringFromFormat("Vertex streamed: %i kB\n", stats.thisFrame.bytesVertexStreamed/1024);
+ str += StringFromFormat("Index streamed: %i kB\n", stats.thisFrame.bytesIndexStreamed/1024);
+ str += StringFromFormat("Uniform streamed: %i kB\n", stats.thisFrame.bytesUniformStreamed/1024);
+ str += StringFromFormat("Vertex Loaders: %i\n", stats.numVertexLoaders);
std::string vertex_list;
VertexLoaderManager::AppendListToString(&vertex_list);
diff --git a/Source/Core/VideoCommon/Statistics.h b/Source/Core/VideoCommon/Statistics.h
index 9f9f97bcbf..55e7121ce3 100644
--- a/Source/Core/VideoCommon/Statistics.h
+++ b/Source/Core/VideoCommon/Statistics.h
@@ -20,17 +20,8 @@ struct Statistics
int numTexturesCreated;
int numTexturesAlive;
- int numRenderTargetsCreated;
- int numRenderTargetsAlive;
-
- int numDListsCalled;
- int numDListsCreated;
- int numDListsAlive;
-
int numVertexLoaders;
- int numUniquePixelShaders;
-
float proj_0, proj_1, proj_2, proj_3, proj_4, proj_5;
float gproj_0, gproj_1, gproj_2, gproj_3, gproj_4, gproj_5;
float gproj_6, gproj_7, gproj_8, gproj_9, gproj_10, gproj_11, gproj_12, gproj_13, gproj_14, gproj_15;
@@ -50,15 +41,12 @@ struct Statistics
int numCPLoadsInDL;
int numXFLoadsInDL;
- int numDLs;
int numPrims;
int numDLPrims;
int numShaderChanges;
int numPrimitiveJoins;
int numDrawCalls;
- int numIndexedDrawCalls;
- int numBufferSplits;
int numDListsCalled;