]> git.cworth.org Git - fips/commit
Rework timer queries to run continuously.
authorCarl Worth <cworth@cworth.org>
Tue, 15 Oct 2013 20:45:06 +0000 (13:45 -0700)
committerCarl Worth <cworth@cworth.org>
Tue, 15 Oct 2013 21:04:52 +0000 (14:04 -0700)
commit8dc8bcb282b0948605e4b526b9787f51c56301d6
tree47a2b6c069a22b2ee73121bdff088374a7bfa06e
parent2ddfc599cf1f15f2eec12ddb24754fe768b38e03
Rework timer queries to run continuously.

Previously, we ran timer queries only around gl calls that we
determined were "drawing operations". This had the following
drawbacks:

1. Lots of timer queries, so more overhead than desired

2. Misses accumulating time from non "drawing operations"

3. Misses accumulating time from drawing operations we failed to
   identify.

Here, instead, we keep the timer running continuously, solving all
three of the above problems. We first start timer at make-current time
(glxMakeCurrent, glxMakeContextCurrent, or eglMakeCurrent), and only
stop it, (and immediately restart it), in one of the following
circumstances:

1. Current program changed (glUseProgram or glUseProgramObjectARB)

2. At each frame end (glxSwapBuffers or eglSwapBuffers)
eglwrap.c
glwrap.c
glxwrap.c