mirror of https://github.com/PCSX2/pcsx2.git
gsdx: improve builtin profiler
* Does the first vsync (start counter) after the sleep * Dump data after the rendering, avoid to count extra destructor,sleep time * Dump data into a basic csv file (if people want nice graph)
This commit is contained in:
parent
8b3e04d1b6
commit
3f03f7333c
|
@ -1569,9 +1569,6 @@ EXPORT_C GSReplay(char* lpszCmdLine, int renderer)
|
||||||
|
|
||||||
file->Read(regs, 0x2000);
|
file->Read(regs, 0x2000);
|
||||||
|
|
||||||
GSvsync(1);
|
|
||||||
|
|
||||||
|
|
||||||
while(!file->IsEof())
|
while(!file->IsEof())
|
||||||
{
|
{
|
||||||
uint8 type;
|
uint8 type;
|
||||||
|
@ -1628,7 +1625,7 @@ EXPORT_C GSReplay(char* lpszCmdLine, int renderer)
|
||||||
delete file;
|
delete file;
|
||||||
}
|
}
|
||||||
|
|
||||||
sleep(1);
|
sleep(2);
|
||||||
|
|
||||||
//while(IsWindowVisible(hWnd))
|
//while(IsWindowVisible(hWnd))
|
||||||
//FIXME map?
|
//FIXME map?
|
||||||
|
@ -1638,6 +1635,10 @@ EXPORT_C GSReplay(char* lpszCmdLine, int renderer)
|
||||||
finished = 1;
|
finished = 1;
|
||||||
}
|
}
|
||||||
unsigned long frame_number = 0;
|
unsigned long frame_number = 0;
|
||||||
|
|
||||||
|
// Init vsync stuff
|
||||||
|
GSvsync(1);
|
||||||
|
|
||||||
while(finished > 0)
|
while(finished > 0)
|
||||||
{
|
{
|
||||||
for(auto i = packets.begin(); i != packets.end(); i++)
|
for(auto i = packets.begin(); i != packets.end(); i++)
|
||||||
|
@ -1690,6 +1691,8 @@ EXPORT_C GSReplay(char* lpszCmdLine, int renderer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static_cast<GSDeviceOGL*>(s_gs->m_dev)->GenerateProfilerData();
|
||||||
|
|
||||||
#ifdef ENABLE_OGL_DEBUG_MEM_BW
|
#ifdef ENABLE_OGL_DEBUG_MEM_BW
|
||||||
unsigned long total_frame_nb = std::max(1ul, frame_number) << 10;
|
unsigned long total_frame_nb = std::max(1ul, frame_number) << 10;
|
||||||
fprintf(stderr, "memory bandwith. T: %f KB/f. V: %f KB/f. U: %f KB/f\n",
|
fprintf(stderr, "memory bandwith. T: %f KB/f. V: %f KB/f. U: %f KB/f\n",
|
||||||
|
@ -1706,7 +1709,7 @@ EXPORT_C GSReplay(char* lpszCmdLine, int renderer)
|
||||||
|
|
||||||
packets.clear();
|
packets.clear();
|
||||||
|
|
||||||
sleep(1);
|
sleep(2);
|
||||||
|
|
||||||
GSclose();
|
GSclose();
|
||||||
GSshutdown();
|
GSshutdown();
|
||||||
|
|
|
@ -95,10 +95,6 @@ GSDeviceOGL::~GSDeviceOGL()
|
||||||
|
|
||||||
GL_PUSH("GSDeviceOGL destructor");
|
GL_PUSH("GSDeviceOGL destructor");
|
||||||
|
|
||||||
if (GLLoader::in_replayer) {
|
|
||||||
GenerateProfilerData();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clean vertex buffer state
|
// Clean vertex buffer state
|
||||||
delete m_va;
|
delete m_va;
|
||||||
|
|
||||||
|
@ -194,6 +190,15 @@ void GSDeviceOGL::GenerateProfilerData()
|
||||||
fprintf(stderr, "Max %4.2f ms\t(%4.2f fps)\n", *minmax_time.second, 1000.0 / *minmax_time.second);
|
fprintf(stderr, "Max %4.2f ms\t(%4.2f fps)\n", *minmax_time.second, 1000.0 / *minmax_time.second);
|
||||||
fprintf(stderr, "SD %4.2f ms\n", sd);
|
fprintf(stderr, "SD %4.2f ms\n", sd);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
|
|
||||||
|
FILE* csv = fopen("GSdx_profile.csv", "w");
|
||||||
|
if (csv) {
|
||||||
|
for (size_t i = 0; i < times.size(); i++) {
|
||||||
|
fprintf(csv, "%d,%lf\n", i, times[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose(csv);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GSTexture* GSDeviceOGL::CreateSurface(int type, int w, int h, bool msaa, int fmt)
|
GSTexture* GSDeviceOGL::CreateSurface(int type, int w, int h, bool msaa, int fmt)
|
||||||
|
|
Loading…
Reference in New Issue