mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-14 00:09:24 +01:00
Sort vertex loader debug statistics by number of verts loaded - now easy to identify the heaviest vertex loader in games.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2252 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
a4aac9ec99
commit
232e961b6f
@ -24,8 +24,6 @@ namespace VertexManager
|
|||||||
|
|
||||||
void AddVertices(int primitive, int numvertices);
|
void AddVertices(int primitive, int numvertices);
|
||||||
void Flush(); // flushes the current buffer
|
void Flush(); // flushes the current buffer
|
||||||
|
|
||||||
// This doesn't really belong here and are not relevant for D3D - TODO, find better place to put them.
|
|
||||||
int GetRemainingSize(); // remaining space in the current buffer.
|
int GetRemainingSize(); // remaining space in the current buffer.
|
||||||
|
|
||||||
// TODO: move, rename.
|
// TODO: move, rename.
|
||||||
|
@ -84,7 +84,7 @@ void LOADERDECL PosMtx_Write()
|
|||||||
|
|
||||||
void LOADERDECL TexMtx_ReadDirect_UByte()
|
void LOADERDECL TexMtx_ReadDirect_UByte()
|
||||||
{
|
{
|
||||||
s_curtexmtx[s_texmtxread] = DataReadU8()&0x3f;
|
s_curtexmtx[s_texmtxread] = DataReadU8() & 0x3f;
|
||||||
PRIM_LOG("texmtx%d: %d, ", s_texmtxread, s_curtexmtx[s_texmtxread]);
|
PRIM_LOG("texmtx%d: %d, ", s_texmtxread, s_curtexmtx[s_texmtxread]);
|
||||||
s_texmtxread++;
|
s_texmtxread++;
|
||||||
}
|
}
|
||||||
@ -700,7 +700,7 @@ void VertexLoader::SetVAT(u32 _group0, u32 _group1, u32 _group2)
|
|||||||
m_VtxAttr.texCoord[7].Frac = vat.g2.Tex7Frac;
|
m_VtxAttr.texCoord[7].Frac = vat.g2.Tex7Frac;
|
||||||
};
|
};
|
||||||
|
|
||||||
void VertexLoader::AppendToString(std::string *dest)
|
void VertexLoader::AppendToString(std::string *dest) const
|
||||||
{
|
{
|
||||||
dest->reserve(250);
|
dest->reserve(250);
|
||||||
static const char *posMode[4] = {
|
static const char *posMode[4] = {
|
||||||
|
@ -63,7 +63,8 @@ public:
|
|||||||
void RunVertices(int vtx_attr_group, int primitive, int count);
|
void RunVertices(int vtx_attr_group, int primitive, int count);
|
||||||
|
|
||||||
// For debugging / profiling
|
// For debugging / profiling
|
||||||
void AppendToString(std::string *dest);
|
void AppendToString(std::string *dest) const;
|
||||||
|
int GetNumLoadedVerts() const { return m_numLoadedVertices; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum
|
enum
|
||||||
|
@ -912,7 +912,7 @@ void Renderer::SwapBuffers()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (g_Config.bOverlayStats) {
|
if (g_Config.bOverlayStats) {
|
||||||
char st[2048];
|
char st[8192];
|
||||||
char *p = st;
|
char *p = st;
|
||||||
if (g_Config.bShowFPS)
|
if (g_Config.bShowFPS)
|
||||||
p+=sprintf(p, "FPS: %d\n", s_fps); // So it shows up before the stats and doesn't make anyting ugly
|
p+=sprintf(p, "FPS: %d\n", s_fps); // So it shows up before the stats and doesn't make anyting ugly
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <vector>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include "VideoCommon.h"
|
#include "VideoCommon.h"
|
||||||
#include "Statistics.h"
|
#include "Statistics.h"
|
||||||
@ -51,11 +53,33 @@ void Shutdown()
|
|||||||
g_VertexLoaderMap.clear();
|
g_VertexLoaderMap.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
struct entry {
|
||||||
|
std::string text;
|
||||||
|
u64 num_verts;
|
||||||
|
bool operator < (const entry &other) const {
|
||||||
|
return num_verts > other.num_verts;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
void AppendListToString(std::string *dest)
|
void AppendListToString(std::string *dest)
|
||||||
{
|
{
|
||||||
for (VertexLoaderMap::iterator iter = g_VertexLoaderMap.begin(); iter != g_VertexLoaderMap.end(); ++iter)
|
std::vector<entry> entries;
|
||||||
|
|
||||||
|
size_t total_size = 0;
|
||||||
|
for (VertexLoaderMap::const_iterator iter = g_VertexLoaderMap.begin(); iter != g_VertexLoaderMap.end(); ++iter)
|
||||||
{
|
{
|
||||||
iter->second->AppendToString(dest);
|
entry e;
|
||||||
|
iter->second->AppendToString(&e.text);
|
||||||
|
e.num_verts = iter->second->GetNumLoadedVerts();
|
||||||
|
entries.push_back(e);
|
||||||
|
total_size += e.text.size() + 1;
|
||||||
|
}
|
||||||
|
sort(entries.begin(), entries.end());
|
||||||
|
dest->reserve(dest->size() + total_size);
|
||||||
|
for (std::vector<entry>::const_iterator iter = entries.begin(); iter != entries.end(); ++iter) {
|
||||||
|
dest->append(iter->text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user