PDA

View Full Version : OpenGL driver support



Wenhui
07-21-2012, 06:42 AM
Recently I just move our code from "glBegin/glEnd" to "VBO/GLSL". It works pretty well and fast.

However if user's video card driver is older, let's say 182 or 191, the code will crash.

Here is my question.

How can I know if my code can work on user's machine. If not, let user update his driver.

Thanks

menzel
07-21-2012, 09:04 AM
You can try to use glGetString with the enums GL_VERSION GL_RENDERER and GL_VENDOR to identify the driver version. These informations don't need to include driver versions and if so, they will be at the implementation defined parts of the string (e.g. GL_VERSION will state the OpenGL context version but might also include more information after that). You can make a black-list of faulty drivers but don't expect the driver strings to follow the same format in future different driver revisions.

Dark Photon
07-21-2012, 09:27 AM
Recently I just move our code from "glBegin/glEnd" to "VBO/GLSL". It works pretty well and fast. However if user's video card driver is older, let's say 182 or 191, the code will crash.
The key is to identify what you're doing on older drivers that they don't support. It may be that you're just assuming that you have GL 3.3 capability when in fact on certain drivers you only have 3.2 or less (for instance). Or you may be assuming the presence of an extension that isn't supported back then. All this is easily checked for.

Looking back in time, it appears (for NVidia at least; don't know whose vendor's drivers you're talking about) 182.x drivers were probably OpenGL 2.1.2 or 3.1 (depending on your GPU) and 191.x were probably OpenGL 2.1.2 or 3.2 (again, depending on your GPU). Looks like OpenGL 3.3 support came about with 256.x (with 195.36.07.0[34] being early versions of that).

Wenhui
07-21-2012, 08:11 PM
You can try to use glGetString with the enums GL_VERSION GL_RENDERER and GL_VENDOR to identify the driver version. These informations don't need to include driver versions and if so, they will be at the implementation defined parts of the string (e.g. GL_VERSION will state the OpenGL context version but might also include more information after that). You can make a black-list of faulty drivers but don't expect the driver strings to follow the same format in future different driver revisions.

Thanks for your reply.


It seems none of these three queries will always return driver info?

Wenhui
07-21-2012, 08:21 PM
The key is to identify what you're doing on older drivers that they don't support. It may be that you're just assuming that you have GL 3.3 capability when in fact on certain drivers you only have 3.2 or less (for instance). Or you may be assuming the presence of an extension that isn't supported back then. All this is easily checked for.

Looking back in time, it appears (for NVidia at least; don't know whose vendor's drivers you're talking about) 182.x drivers were probably OpenGL 2.1.2 or 3.1 (depending on your GPU) and 191.x were probably OpenGL 2.1.2 or 3.2 (again, depending on your GPU). Looks like OpenGL 3.3 support came about with 256.x (with 195.36.07.0[34] being early versions of that).

Thanks for your reply.

Happy to hear that "all this is easily checked for".

I am mainly work on N card, however A card also need to be supported. Fortunately no bug report yet on A card.

Could you be more details please? Should I check if OpenGL version is 3.3 or higher? Or check if driver version is 256 or higher? BTW, how to get driver info?

thanks in advance.

menzel
07-22-2012, 02:39 AM
Thanks for your reply.

It seems none of these three queries will always return driver info?


No, identifying the driver is not guaranteed. But if your goal is to identify known drivers with known bugs, you can check if that specific drivers return unique strings. For checking OpenGL support, use the version number and the extension strings.

Wenhui
07-22-2012, 07:06 PM
No, identifying the driver is not guaranteed. But if your goal is to identify known drivers with known bugs, you can check if that specific drivers return unique strings. For checking OpenGL support, use the version number and the extension strings.


thanks for your info.

could you give me a example about how to the driver check and the opengl support check?

many thanks.