From b87cfc3c7eb9e5ea38d2805bfce7f2facc57bd21 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 10:29:21 +0800 Subject: Core profile query related functions replacing their legacy ARB counterparts. --- indra/llrender/llglslshader.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 48bdfb6b51..d18ee6d947 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -230,8 +230,8 @@ void LLGLSLShader::placeProfileQuery() #if !LL_DARWIN if (mTimerQuery == 0) { - glGenQueriesARB(1, &mSamplesQuery); - glGenQueriesARB(1, &mTimerQuery); + glGenQueries(1, &mSamplesQuery); + glGenQueries(1, &mTimerQuery); } if (!mTextureStateFetched) @@ -267,16 +267,24 @@ void LLGLSLShader::placeProfileQuery() } - glBeginQueryARB(GL_SAMPLES_PASSED, mSamplesQuery); - glBeginQueryARB(GL_TIME_ELAPSED, mTimerQuery); +#if GL_VERSION_1_5 + glBeginQuery(GL_SAMPLES_PASSED, mSamplesQuery); +#if GL_VERSION_3_3 + glBeginQuery(GL_TIME_ELAPSED, mTimerQuery); +#endif // GL_VERSION_3_3 +#endif // GL_VERSION_1_5 #endif } void LLGLSLShader::readProfileQuery(U32 count, U32 mode) { #if !LL_DARWIN - glEndQueryARB(GL_TIME_ELAPSED); - glEndQueryARB(GL_SAMPLES_PASSED); +#if GL_VERSION_1_5 +#if GL_VERSION_3_3 + glEndQuery(GL_TIME_ELAPSED); +#endif // GL_VERSION_3_3 + glEndQuery(GL_SAMPLES_PASSED); +#endif // GL_VERSION_1_5 GLuint64 time_elapsed = 0; glGetQueryObjectui64v(mTimerQuery, GL_QUERY_RESULT, &time_elapsed); @@ -364,13 +372,13 @@ void LLGLSLShader::unloadInternal() if (mTimerQuery) { - glDeleteQueriesARB(1, &mTimerQuery); + glDeleteQueries(1, &mTimerQuery); mTimerQuery = 0; } if (mSamplesQuery) { - glDeleteQueriesARB(1, &mSamplesQuery); + glDeleteQueries(1, &mSamplesQuery); mSamplesQuery = 0; } -- cgit v1.2.3