Im using Shaders with OpenGL through nvidia’s cg library. When initializing the pixel shader profile, it returns with the invalid profile error. Here is the init:
cgContext = cgCreateContext();//ok
…
creating a Vertex Shader profile and Program, went ok
…
cgPixelProfile = cgGLGetLatestProfile(CG_GL_FRAGMENT);
if (cgPixelProfile == CG_PROFILE_UNKNOWN)
{
//this error occurs
GEngine_SendErrorMsg(“Invalid Profile Type (PS)”);
exit(0);
}
My program runs on a Radeon9700 perfectly, but on my Radeon8500 fails. Could somebody help? Im quite new in shader programming, and not everything is clear about shader versions, profiles, compability, etc.
CG does not support fragment shaders on Radeon 8500. It probably supports some simple shaders on GeForce3/4, through the NVIDIA register combiner extension, but for obvious reasons they didn’t write support for the ATI texture shader extension.
On a Radeon 8500 you have to use ATI_fragment_shader. AFAIK, Cg doesn’t have a profile for it and won’t unless ATI writes one (which they certainly won’t).