OGL: Fix perf metrics being overcounted when using a non-native internal resolution.
This commit is contained in:
parent
4058b4c38a
commit
d1acb0a937
|
@ -103,6 +103,7 @@ void PerfQuery::FlushOne()
|
||||||
hr = D3D::context->GetData(entry.query, &result, sizeof(result), 0);
|
hr = D3D::context->GetData(entry.query, &result, sizeof(result), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE: Reported pixel metrics should be referenced to native resolution
|
||||||
m_results[entry.query_type] += result * EFB_WIDTH * EFB_HEIGHT / g_renderer->GetTargetWidth() / g_renderer->GetTargetHeight();
|
m_results[entry.query_type] += result * EFB_WIDTH * EFB_HEIGHT / g_renderer->GetTargetWidth() / g_renderer->GetTargetHeight();
|
||||||
|
|
||||||
m_query_read_pos = (m_query_read_pos + 1) % ARRAYSIZE(m_query_buffer);
|
m_query_read_pos = (m_query_read_pos + 1) % ARRAYSIZE(m_query_buffer);
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#include "RenderBase.h"
|
||||||
#include "GLUtil.h"
|
#include "GLUtil.h"
|
||||||
#include "PerfQuery.h"
|
#include "PerfQuery.h"
|
||||||
|
|
||||||
|
@ -65,7 +66,8 @@ void PerfQuery::FlushOne()
|
||||||
GLuint result = 0;
|
GLuint result = 0;
|
||||||
glGetQueryObjectuiv(entry.query_id, GL_QUERY_RESULT, &result);
|
glGetQueryObjectuiv(entry.query_id, GL_QUERY_RESULT, &result);
|
||||||
|
|
||||||
m_results[entry.query_type] += result;
|
// NOTE: Reported pixel metrics should be referenced to native resolution
|
||||||
|
m_results[entry.query_type] += result * EFB_WIDTH * EFB_HEIGHT / g_renderer->GetTargetWidth() / g_renderer->GetTargetHeight();
|
||||||
|
|
||||||
m_query_read_pos = (m_query_read_pos + 1) % ARRAYSIZE(m_query_buffer);
|
m_query_read_pos = (m_query_read_pos + 1) % ARRAYSIZE(m_query_buffer);
|
||||||
--m_query_count;
|
--m_query_count;
|
||||||
|
|
Loading…
Reference in New Issue