Jump to content
  • Advertisement
Sign in to follow this  

cgGLGetLatestProfile versus fixed CG_PROFILE_VP30?

This topic is 2225 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 have a number of shaders that need at least shader model 3.0 to compile. Now I am wondering whether it is smarter to load these functions with this profile explicitly, or to just use cgGLGetLatestProfile?

So like this:

cgCreateProgramFromFile(..., cgGLGetLatestProfile(CG_GL_VERTEX), ...);

or like this?

cgCreateProgramFromFile(..., CG_PROFILE_VP30, ...);

(similar for fragment programs)

Does it make any difference at all which I use? Are there situations where using the flexible latest profile will work, while VP30 will not? Are there situations where cgGLGetLatestProfile will give different results from the fixed one? For example because something behaves differently in VP50 than in VP30, so what I compile with would make a difference?

Thanks in advance! :) Edited by Oogst

Share this post

Link to post
Share on other sites
No one answered, but I experimentally found some more info on this. Since I figured compiling to the same profile would give most consistency, I went for the fixed CG_PROFILE_VP30. However, I learned that this is not a good idea.

It turns out that the Ati HD4 series of cards will claim that CG_PROFILE_VP30 is not supported, and it won't compile my shaders any more. The weird thing is that this card does support shader model 3.0, but a call to cgGLGetLatestProfile() returns ARBVP1, the very first and very oldest shader model. This does not make any sense to me, but if I load my shader model 3.0 shaders with ARBVP1, it works fine on the Ati HD4 series.

Maybe ARBVP1 is not exactly what I think it is? When I try compiling my shaders with this profile on my Geforce 560 it also works, while using CG_PROFILE_VP20 (shader model 2.0) gives compile errors (as it should). Online I read that ARBVP1 should indeed represent the ancient shader model 1.0, but apparently not?

Anyway, I tried dozens of videocards and just using cgGLGetLatestProfile() worked fine everywhere, so I am going to settle for that.

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!