• 15
• 15
• 11
• 9
• 10

# cgGLGetLatestProfile versus fixed CG_PROFILE_VP30?

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

## 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:

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

or like this?

cgGLEnableProfile(CG_PROFILE_VP30); 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 on other sites
Does no one here know whether this makes a difference?

##### 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.