Jump to content
  • Advertisement
Sign in to follow this  
Hardguy

Checking GfxCard Caps

This topic is 4851 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need to use different vertex/fragment programs depending on what graphics card the user has. Is there some way to check the max number of instructions, max texture units, etc for a driver? EDIT: I am using Cg to do my programs. Is there some way to check if my program runs on a certain card?

Share this post


Link to post
Share on other sites
Advertisement
for max texture units use glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB,&tex_units); or (on newer cards) glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB,&tex_image_units); and glGetIntegerv(GL_MAX_TEXTURE_COORDS_ARB,&tex_coord_units);

Newer cards have separate number of texcoord/image units so you should always check for it.

Max number of instructions depends not only on card itself but on extensions you choose to use for shaders (which Cg selects for you). Simplest way would be just to try to compile Cg shader in current profile and if it fails then select lower shader :-) Or you can check what codepath Cg has selected and load shaders for it...

Share this post


Link to post
Share on other sites
When I compile a program under arbfp1 for example, I can use normalize and other stuff which I am quite sure some cards using that profile doesn't support... So is really arbfp1 a good messurement of what the framgment program can handle?

Share this post


Link to post
Share on other sites
you can normalize vectors on any ARB_fragment_program capable card. There is no instruction for normalization, but it can be easily computed via DP4,RSQ and MUL instructions...

But you should always let Cg select the best (e.g. highest) codepath available for shaders...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!