diff options
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r-- | indra/newview/llvoavatar.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 35e45c6cd9..fabb659b83 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -11487,24 +11487,38 @@ void LLVOAvatar::placeProfileQuery() glGenQueries(1, &mGPUTimerQuery); } - glBeginQuery(GL_TIME_ELAPSED, mGPUTimerQuery); +#if GL_EXT_timer_query || GL_EXT_disjoint_timer_query + glBeginQuery(GL_TIME_ELAPSED_EXT, mGPUTimerQuery); +#endif } void LLVOAvatar::readProfileQuery(S32 retries) { if (!mGPUProfilePending) { - glEndQuery(GL_TIME_ELAPSED); +#if GL_EXT_timer_query || GL_EXT_disjoint_timer_query + glEndQuery(GL_TIME_ELAPSED_EXT); +#endif mGPUProfilePending = true; } +#if GL_ARB_timer_query GLuint64 result = 0; glGetQueryObjectui64v(mGPUTimerQuery, GL_QUERY_RESULT_AVAILABLE, &result); +#else + GLuint result = 0; + glGetQueryObjectuiv(mGPUTimerQuery, GL_QUERY_RESULT_AVAILABLE, &result); +#endif if (result == GL_TRUE || --retries <= 0) { // query available, readback result +#if GL_ARB_timer_query GLuint64 time_elapsed = 0; glGetQueryObjectui64v(mGPUTimerQuery, GL_QUERY_RESULT, &time_elapsed); +#else + GLuint time_elapsed = 0; + glGetQueryObjectuiv(mGPUTimerQuery, GL_QUERY_RESULT, &time_elapsed); +#endif mGPURenderTime = time_elapsed / 1000000.f; mGPUProfilePending = false; |