PDA

View Full Version : Determining OpenGL hardware acceleration



06-14-2000, 08:57 AM
Is there a way, using OpenGL calls, to determine if the graphics card on the system supports ANY 3D acceleration?

I'd like to be able to disable some features (such as mipmapping) if the user doesn't have hardware support (to help keep frame rates higher).

I'm specifically looking for a Windows-based answer, but any help is appreciated.

Thanks.

mR

Relic
06-14-2000, 12:42 PM
Enumerate all pixelformats with DescribePixeformat() and check the dwFlags member for the bits PFD_GENERIC_FORMAT and PFD_GENERIC_ACCELERATED.

PFD_GENERIC_FORMAT is unaccelerated, PFD_GENERIC_ACCELERATED could be an MCD.

If you find one without those two flags you have a full ICD running. But that doesn't tell you something about the performance.

On a hardware accelerated board, normally the last ones are provided by Microsoft's GDI Generic OpenGL implementation. That means you can choose which ever fits your needs at run time. For example no hardware implementation supports PFD_DRAW_TO_BITMAP, but that can be used for printing.



[This message has been edited by Relic (edited 06-14-2000).]

john
06-14-2000, 04:07 PM
Argh. I've said this before, and i'm sayin' it again. http://www.opengl.org/discussion_boards/ubb/biggrin.gif

In their documentation, even SGI conceed that there is no mechanism in openGL to query h/w support for a given function. Granted, you can ask it if the driver KNOWS about a function, but that's only so the driver won't throw its hands up in horror when you try to do something it has no idea about. It says nothing about the extensions been done in h/w or not.

The only answer, again, from SGI's tech stuff, is to profile the machine. http://www.opengl.org/discussion_boards/ubb/eek.gif But! If you think about it!! It makes perfect sense. At the end of the day, your app doesn't care if function X is supported in h/w or not; *ALL* that you're interested in is whether it _adequately supports function X_.

Using your example, suppose you wanted to make a decision to retain or axe mipmapping. So, you run two (toy) benchmark programs, one with mipmapping and one without. Suppose you get 25 fps WITH mipmapping, and 35 fps WITHOUT it. Now, do you REALLY care if mimapping is done in hardware?? I would argue that the answer is no: the results demonstrate that the machine, with whatever video card and drivers, can mipmap quite adequately (if 25fps is acceptable to you, that is). Now, suppose you run this program on antoher machine, and get 5 fps with mipmapping and 25 fps without it. What do you use? What if I told you that this second machine was a ye olde voodoo1 card running on a Pentium 1, and the first machine was a poxy card with no h/w support but running on an P3? Does the fact the second machine have h/w suport (supposedly) make any difference??

my 2c worth!
cheers,
John

Relic
06-15-2000, 08:41 AM
Originally posted by john:
Argh. I've said this before, and i'm sayin' it again. http://www.opengl.org/discussion_boards/ubb/biggrin.gif


Isn't that what I said, too?


Originally posted by Relic:
If you find one without those two flags you have a full ICD running. But that doesn't tell you something about the performance.

john
06-15-2000, 04:14 PM
<looks nervously from side to side> uhm... yes http://www.opengl.org/discussion_boards/ubb/redface.gif

but I wanted to stress the futility of knowing if something is done in h/w or not. Ultimately it doesn't matter.