glGetDoublev(GL_PROJECTION_MATR, ...) on Windows 7

Hi All,

Is it possible that the call to glGetDoublev(GL_PROJECTION_MATRIX,…) is significantly slower than glGetDoublev(GL_MODELVIEW_MATRIX, …) on Windows 7 ?

Is there any meaningful reason for this?

Should I look for a new graphics driver?

Thanks,

Alberto

If you care about performance, avoid any glGet*.
What are your measured times in milliseconds, for each call ? Is it different with different OS versions, or with glGetFloatv(*) ?

I can understand a difference between different OS but not 1.6 sec for getting projection matrix and 0.001 sec for getting model view one, what do you think?

Thanks,

Alberto

EDIT: those timing are actually for calling glGetDoublev() 100 times…

16 ms is not that slow for something nobody should use :wink: Well my idea is that it is not optimized at all. Maybe only modelview is cached by the driver.
BTW, what driver/hardware is that ?
Any difference with the glGetFloatv versions ?

Just noticed that after upgtrading to Windows 7 a Microsoft driver came into play.

Ok, so you recommend to use custom glOrtho/Perspective and keep a copy of the matrices in memory?

Thanks,

Alberto

grab the values as floats
no doubt the driver only uses floats anyway

you should never use any glGet functions in your render loop. In other words, it’s fine to use them to grab limits, such as maximum texture size etc. but only at initialisation time. Sometimes you’ll be lucky and the glGet won’t make your app synchronise with the GL implementation, but a lot of the time it will (ie. your render thread will stall waiting for the driver thread to get to your glGet request).

It’s the first time we see this kind of slow down with glGetXxx…

Again, do you recommend to copy glOrtho/glPerspective/gluLookAt source code inside our app and keep a reference to those matrices without using glGetDoublev()?

Thanks,

Alberto

“… and glGet, virtual memory allocations and a healthy dose of gratuitous file IO never hurt anybody."
– Binglebrook Botch in “On the Immovable Object and Irresistible Force: Ruminations on a Midsummer’s Morn”

Again, do you recommend to copy glOrtho/glPerspective/gluLookAt source code inside our app and keep a reference to those matrices without using glGetDoublev()?

I recommend changing whatever code you’re using that actually needs to know the full projection matrix. You passed glPerspective the parameters, so clearly you have the matrix (or something close to it). If you’re using gluLookAt, then you know what the camera point is, and what the direction of view is.

In short, there is no reason why you need the projection matrix on the CPU in matrix form. Unless you’re doing CPU transformations. In which case yes, you should replicate this code in your application.

I got the point, thanks.

I finally discovered why I was experiencing so many issue under Windows 7 x64 after upgrading from Windows Vista x64. The OpenGL version is 1.1.0 therefore I am currently using the Microsoft Generic driver.

Is it possible that a Windows 7 driver for my ATI FireGL 7200 is not available?

I tried downloading the following two drivers from AMD.com:

FirePro_8.663.3_Win7x64_91195.exe
FirePro_8.583_Vista64_77160.exe

but cannot be installed (the install program disappears without reason).

Any help is greatly appreciated thanks.

Alberto