Yes, it’s kind of dangerous to rely on the NV compiler. When GLSL came out, many developers found their shaders failing on ATI hardware, it’s very easy to write nonconformant code. Then NV Emulate added a nice “Strict Shader Portability Warnings” option, that forces the compiler to report any conformance issues. It works great and I never had any problems after that.
Besides, being able to write Cg stuff inside GLSL is almost critical for us, especially when you need to use half fp types to keep the crappy GeFX line of cards running decently. It’s quickly getting rather ugly though:
#ifndef __GLSL_CG_DATA_TYPES
#define half float
#define half2 vec2
#define half3 vec3
#define half4 vec4
#define half3x3 mat3
#define h4tex2D texture2D
#endif
...
#ifndef __GLSL_CG_DATA_TYPES
void main(void)
#else
half4 main(void) : COLOR
#endif
{
....
#ifndef __GLSL_CG_DATA_TYPES
gl_FragColor = colorOUT;
#else
return colorOUT;
#endif
}