summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2014-03-24 11:56:02 -0500
committerDave Parks <davep@lindenlab.com>2014-03-24 11:56:02 -0500
commite43f43b4d9dbcaeb20884772b3fcba6df5e9a62c (patch)
tree99f97631472a626d9aa72cae6f5fa09d1327d8a9 /indra/newview
parentc142696f9dd18dcebee903444225026caf08e6e3 (diff)
MAINT-3131 Attempt to work around drivers that lack timer query and ignore glFinish calls.
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llglsandbox.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index f620bf19fb..0a423e6785 100755
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -969,6 +969,8 @@ F32 gpu_benchmark()
//wait for any previoius GL commands to finish
glFinish();
+ bool busted_finish = false;
+
for (S32 c = -1; c < samples; ++c)
{
LLTimer timer;
@@ -983,7 +985,18 @@ F32 gpu_benchmark()
}
//wait for current batch of copies to finish
- glFinish();
+ if (busted_finish)
+ {
+ //read a pixel off the last target since some drivers seem to ignore glFinish
+ dest[count-1].bindTarget();
+ U32 pixel = 0;
+ glReadPixels(0,0,1,1,GL_RGBA, GL_UNSIGNED_BYTE, &pixel);
+ dest[count-1].flush();
+ }
+ else
+ {
+ glFinish();
+ }
F32 time = timer.getElapsedTimeF32();
@@ -994,7 +1007,14 @@ F32 gpu_benchmark()
F32 gbps = gb/time;
- results.push_back(gbps);
+ if (!gGLManager.mHasTimerQuery && !busted_finish && gbps > 128.f)
+ { //unrealistically high bandwidth for a card without timer queries, glFinish is probably ignored
+ busted_finish = true;
+ }
+ else
+ {
+ results.push_back(gbps);
+ }
}
}