summaryrefslogtreecommitdiff
path: root/indra/llrender/llglslshader.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2023-09-11 13:39:47 +0800
committerErik Kundiman <erik@megapahit.org>2023-09-11 13:39:47 +0800
commit4a97679e2cbee997b5bcf85e8e2c094e2c7bb936 (patch)
tree834fbdcd7c2b4dca7fd28da762f6970adb0afd87 /indra/llrender/llglslshader.cpp
parent5dd6cf2db9c6aaaf7337161db85a8920b1b7d835 (diff)
Use non 64 versions when no ARB timer query
Diffstat (limited to 'indra/llrender/llglslshader.cpp')
-rw-r--r--indra/llrender/llglslshader.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 867b4b6761..67c5da3005 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -264,8 +264,13 @@ bool LLGLSLShader::readProfileQuery(bool for_runtime, bool force_read)
if (mProfilePending && for_runtime && !force_read)
{
+#if GL_ARB_timer_query
GLuint64 result = 0;
glGetQueryObjectui64v(mTimerQuery, GL_QUERY_RESULT_AVAILABLE, &result);
+#else
+ GLuint result = 0;
+ glGetQueryObjectuiv(mTimerQuery, GL_QUERY_RESULT_AVAILABLE, &result);
+#endif
if (result != GL_TRUE)
{
@@ -273,18 +278,31 @@ bool LLGLSLShader::readProfileQuery(bool for_runtime, bool force_read)
}
}
+#if GL_ARB_timer_query
GLuint64 time_elapsed = 0;
glGetQueryObjectui64v(mTimerQuery, GL_QUERY_RESULT, &time_elapsed);
+#else
+ GLuint time_elapsed = 0;
+ glGetQueryObjectuiv(mTimerQuery, GL_QUERY_RESULT, &time_elapsed);
+#endif
mTimeElapsed += time_elapsed;
mProfilePending = false;
if (!for_runtime)
{
+#if GL_ARB_timer_query
GLuint64 samples_passed = 0;
glGetQueryObjectui64v(mSamplesQuery, GL_QUERY_RESULT, &samples_passed);
GLuint64 primitives_generated = 0;
glGetQueryObjectui64v(mPrimitivesQuery, GL_QUERY_RESULT, &primitives_generated);
+#else
+ GLuint samples_passed = 0;
+ glGetQueryObjectuiv(mSamplesQuery, GL_QUERY_RESULT, &samples_passed);
+
+ GLuint primitives_generated = 0;
+ glGetQueryObjectuiv(mPrimitivesQuery, GL_QUERY_RESULT, &primitives_generated);
+#endif
sTotalTimeElapsed += time_elapsed;
sTotalSamplesDrawn += samples_passed;