Elapsed timer queries are virtual and support multiple queries.
GPUTiming now handles the virtualization of elapsed timer queries
which allow us to support multiple queries across different uses. For
example we can now do internal timings for performance reasons, as
well as using the GPUTracer, as well as supporting WebGL related
query calls.
Along with the virtualization of timer queries, using the elapsed
timer mode in GPUTiming also estimates the time stamp that
GL_ARB_timer_query and GL_EXT_disjoint_timer_query would normally
return using GL_TIME_ELAPSED_EXT. This allows us to workaround issues
when the drivers are not working properly with reasonable values.
Most of the code here is due to the fact that GL_TIME_ELAPSED_EXT has a
limitation where only 1 query can only be allowed in a GL Context. What
I have basically done is split up queries into multiple query chunks
and adding them up at the end. Since queries are correct relative to
one another when they are stacking on top of each other, the GPU timer
can utilize the end and start time to figure out the delta.
R=sievers@chromium.org, vmiura@chromium.org
BUG=453965, 345227
Review URL: https://codereview.chromium.org/
1152153006
Cr-Commit-Position: refs/heads/master@{#334922}