Merge pull request #452 from degasus/stats

Video statistics update
This commit is contained in:
Lioncash 2014-06-29 16:41:54 -04:00
commit d720e3ed0b
6 changed files with 25 additions and 41 deletions

View File

@ -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();

View File

@ -123,6 +123,7 @@ void SHADER::Bind()
{
if (CurrentProgram != glprogid)
{
INCSTAT(stats.thisFrame.numShaderChanges);
glUseProgram(glprogid);
CurrentProgram = glprogid;
}

View File

@ -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)

View File

@ -97,7 +97,6 @@ void InterpretDisplayList(u32 address, u32 size)
{
Decode();
}
INCSTAT(stats.numDListsCalled);
INCSTAT(stats.thisFrame.numDListsCalled);
// un-swap

View File

@ -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);

View File

@ -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;