obviously . if you link these two shaders . driver should throw a error.
but in fact ,NVidia’s driver dose not .
In my notebook . GPU is NV7400Go . Driver is 84.26, those two shader worked very well.
In my PC , GPU is NV6600 , Driver is 84.xx, those two shader worked well too …
upgrade driver to 91.47. just not work . but nothing can got by glGetProgramiv(,GL_INFO_LOG_LENGTH) ;
Warning: varying Texcoord is written to in the vertex shader but not read in the fragment shader.
Link successful. The GLSL vertex shader will run in hardware. The GLSL fragment shader will run in hardware.
I think that should generate an error, assuming you actually reference the varying in question in the fragment shader. The spec seems to state that a fragment shader can only read varyings that the vertex shader actually writes to.
Though in my humble opinion an error is a bit harsh. A warning would do nicely, I think, like what V-man described.
Personally, I get no errors or messages of any kind in the logs (NV40, FW91.47).
Originally posted by Leghorn:
Personally, I get no errors or messages of any kind in the logs (NV40, FW91.47).
The example log from V-man is specific to the ATI cards. On Nvidia cards I have seen only compilation errors and, in the latest drivers, warnings when nonstandard elements from Cg are used in glsl.
On Nvidia cards I have seen only compilation errors
Are you using beta drivers?
Try something like this:
void main()
{
gl_Position = ftransform();
}
...
// Varying NaughtyVec4 is not declared or used in the vertex shader
varying vec4 NaughtyVec4;
void main()
{
gl_FragColor = NaughtyVec4;
}
I get no errors or warnings in program or shader logs during compilation, linking, validation or runtime.
Probably splitting hairs here, and I probably wouldn’t have noticed this myself until being mugged by a ruinous typo around 4am.
Personally, I get no errors or messages of any kind in the logs (NV40, FW91.47).
In FW84.26 , these two shader even works well.
I think maybe because of case sensitive