Sign in to follow this  

cgGLGetLatestProfile versus fixed CG_PROFILE_VP30?

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), ...);[/code]

or like this?

cgCreateProgramFromFile(..., CG_PROFILE_VP30, ...);[/code]

(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 [i]not[/i] 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this