Skip to content
Snippets Groups Projects
Commit c9b26b11 authored by Graham Linden's avatar Graham Linden
Browse files

Merge avoiding use of timer query ARB extension when not available.

parents 5bc81b11 9eeb8344
No related branches found
No related tags found
No related merge requests found
...@@ -263,18 +263,29 @@ void LLGLSLShader::placeProfileQuery() ...@@ -263,18 +263,29 @@ void LLGLSLShader::placeProfileQuery()
glBeginQueryARB(GL_SAMPLES_PASSED, mSamplesQuery); glBeginQueryARB(GL_SAMPLES_PASSED, mSamplesQuery);
glBeginQueryARB(GL_TIME_ELAPSED, mTimerQuery);
if (gGLManager.mHasTimerQuery)
{
glBeginQueryARB(GL_TIME_ELAPSED, mTimerQuery);
}
#endif #endif
} }
void LLGLSLShader::readProfileQuery(U32 count, U32 mode) void LLGLSLShader::readProfileQuery(U32 count, U32 mode)
{ {
#if !LL_DARWIN #if !LL_DARWIN
glEndQueryARB(GL_TIME_ELAPSED); if (gGLManager.mHasTimerQuery)
{
glEndQueryARB(GL_TIME_ELAPSED);
}
glEndQueryARB(GL_SAMPLES_PASSED); glEndQueryARB(GL_SAMPLES_PASSED);
U64 time_elapsed = 0; U64 time_elapsed = 0;
glGetQueryObjectui64v(mTimerQuery, GL_QUERY_RESULT, &time_elapsed); if (gGLManager.mHasTimerQuery)
{
glGetQueryObjectui64v(mTimerQuery, GL_QUERY_RESULT, &time_elapsed);
}
U64 samples_passed = 0; U64 samples_passed = 0;
glGetQueryObjectui64v(mSamplesQuery, GL_QUERY_RESULT, &samples_passed); glGetQueryObjectui64v(mSamplesQuery, GL_QUERY_RESULT, &samples_passed);
......
...@@ -954,7 +954,7 @@ F32 gpu_benchmark() ...@@ -954,7 +954,7 @@ F32 gpu_benchmark()
//make a dummy triangle to draw with //make a dummy triangle to draw with
LLPointer<LLVertexBuffer> buff = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, GL_STATIC_DRAW_ARB); LLPointer<LLVertexBuffer> buff = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, GL_STATIC_DRAW_ARB);
buff->allocateBuffer(3, 0, true); buff->allocateBuffer(12, 0, true);
LLStrider<LLVector3> v; LLStrider<LLVector3> v;
LLStrider<LLVector2> tc; LLStrider<LLVector2> tc;
...@@ -964,6 +964,16 @@ F32 gpu_benchmark() ...@@ -964,6 +964,16 @@ F32 gpu_benchmark()
v[0].set(-1,1,0); v[0].set(-1,1,0);
v[1].set(-1,-3,0); v[1].set(-1,-3,0);
v[2].set(3,1,0); v[2].set(3,1,0);
v[3].set(-1,1,0);
v[4].set(-1,-3,0);
v[5].set(3,1,0);
v[6].set(-1,1,0);
v[7].set(-1,-3,0);
v[8].set(3,1,0);
v[9].set(-1,1,0);
v[10].set(-1,-3,0);
v[11].set(3,1,0);
buff->flush(); buff->flush();
gBenchmarkProgram.bind(); gBenchmarkProgram.bind();
...@@ -983,7 +993,7 @@ F32 gpu_benchmark() ...@@ -983,7 +993,7 @@ F32 gpu_benchmark()
{ {
dest[i].bindTarget(); dest[i].bindTarget();
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, source[i]); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, source[i]);
buff->drawArrays(LLRender::TRIANGLES, 0, 3); buff->drawArrays(LLRender::TRIANGLES, 0, 12);
dest[i].flush(); dest[i].flush();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment