gsdx-ogl: fix builtin profiler frame counting

This commit is contained in:
Gregory Hainaut 2016-07-03 15:54:58 +02:00
parent cc62e8c785
commit a1a5f470f7
1 changed files with 6 additions and 6 deletions

View File

@ -146,10 +146,10 @@ GSDeviceOGL::~GSDeviceOGL()
void GSDeviceOGL::GenerateProfilerData() void GSDeviceOGL::GenerateProfilerData()
{ {
if (m_profiler.last_query < 3) return; if (m_profiler.last_query < 3) {
glDeleteQueries(1 << 16, m_profiler.timer_query);
// Point to the last query return;
m_profiler.last_query--; }
// Wait latest quey to get valid result // Wait latest quey to get valid result
GLuint available = 0; GLuint available = 0;
@ -162,8 +162,8 @@ void GSDeviceOGL::GenerateProfilerData()
std::vector<double> times; std::vector<double> times;
double ms = 0.000001; double ms = 0.000001;
float replay = (float)(theApp.GetConfigI("linux_replay")); int replay = theApp.GetConfigI("linux_replay");
int first_query = static_cast<int>((float)m_profiler.last_query / replay); int first_query = replay > 1 ? m_profiler.last_query / replay : 0;
glGetQueryObjectui64v(m_profiler.timer_query[first_query], GL_QUERY_RESULT, &time_start); glGetQueryObjectui64v(m_profiler.timer_query[first_query], GL_QUERY_RESULT, &time_start);
for (uint32 q = first_query + 1; q < m_profiler.last_query; q++) { for (uint32 q = first_query + 1; q < m_profiler.last_query; q++) {