
508 VI Debugging and Profiling
way, as we do for the CPU, without severely affecting the performance. We need
to rely on the a synchronous timer query mechanism provided by OpenGL, which is
discussed in depth in Chapter 34. In order to support nested markers, we prefer the
glQueryCounter mechanism over glBeginQuery/glEndQuery pairs.
A consequence of this is that the profiler cannot display timing information
for a given frame until the results of the timer queries issued in this frame be-
come available. Therefore, we record timing information for several frames and
display the information related to the most ancient one. We found that a num-
ber of