pouët.net

OpenGL performance measurment?

category: general [glöplog]
 
What's the most precise way of measuring how fast an operation is?
Or in other words, how can I know when an OpenGL call gets executed and finished... I'm assuming every call is asynchronous, so measuring the time before and after drawing a list doesn't do it.
added on the 2010-01-15 05:56:55 by xernobyl xernobyl
using glFinish/glFlush to synchronize CPU and GPU is very slow, but can be used in a desperate situation to measure performance. Otherwise, have a look to Opengl fences

added on the 2010-01-15 06:06:51 by iq iq
ATI here ;)

http://www.opengl.org/wiki/Performance#Measuring_Performance
Definitively not the best solution there.

GL_AMD_performance_monitor seems to do the trick... at least it sounds like it.
added on the 2010-01-15 07:07:04 by xernobyl xernobyl
You can use fences as well - if I remember correctly they just made into the core (pretty much identical to nvfence).

I would really like to be able to recommend gdebugger - but it's insanely expensive. Which is too bad, because it seems like a brilliant tool.

They really should do some special deal for demo-sceners :D
added on the 2010-01-15 11:42:30 by hornet hornet
I see iq already supplied that piece of useless info. But fences did make it into the core though, so you should be able to use it even if you're on ATI.

http://www.opengl.org/registry/doc/glspec32.core.20091207.pdf
added on the 2010-01-15 11:51:04 by hornet hornet
use glFinish before starting a timer, and glFinish again before querying the difference, it will empty the command queue on the driver side. Else your measures will be biased. and glFlush does nothing actually (it was used in the early 90s in the client/server model).
added on the 2010-01-15 12:43:15 by nystep nystep
or use one of the more modern ways as kusma & hornet said. :)
added on the 2010-01-15 12:48:25 by nystep nystep
Just listen to kusma, he's got it right. I don't think there's an easy way to get fences to work as well as the ext_timer_query (bar threading hell).

Also on a side note, gdebugger is currently fairly useless for very specific performance debugging currently - but very useful for debugging.
(it would seem they chose the name well). It does have access to all the vendor-specific timers though, which is always useful.
added on the 2010-01-20 21:27:37 by hornet hornet

login