I returned to some GLSL that I updated some time ago. I had moved from an nVidia card to an ATI card and had left the script in what I thought was a complaint form, however a VP of…
out struct avShader
out vec4 T;
out vec3 N;
out vec3 P;
in vec4 T;
_CurShader.T = T;
now throws warnings and errors that this convention no longer works.
Any suggestions would be much appreciated!
GL version string is reported as: “4.0.10243 Compatibility Profile Context”
ps I can probably avoid using structs in this way, but since Im sure I had it working, Id like to know why and what /if there has been a change to the specs… its very difficult to get proper info on structs for interpolating!
I dont suppose you know where I can find the ATI link error documentation?
I don’t know how that’s going to help you. The error is pretty self-explanatory. GLSL requires that the in/out interfaces are defined the same way, including struct definitions.
The ATI compiler thinks that they are not. Therefore, one of two things is happening. Either they actually are not defined identically, in which case you need to fix your shaders, or it’s a driver bug. ATI link error documentation isn’t going to fix your shaders or fix the driver bug.
Sure, but it should list some conditions under which the error is thrown that may not be obvious. The shader whilst relatively large isnt particularly complex and has run on this card before with the same catalyst drivers. Its just vanilla blinn, but with extensive parametrisation as uniform values are set from my scene graph.
Whilst I initially shared your optimism that its a case of following the error to a logical solution, the struct it mentions is byte for byte identical in both VP and FP.
There is a difference in that im now using GL through OpenTK rather than Tao (both C# Gl wrappers) so that could well have something to do with it.
Tao vs OpenTK shouldn’t make a difference, both are passing the shader text directly to the driver. This could be a driver error; or it could be a user error.
Try reading back the shader source using GL.GetShaderSource() and verify that it is identical to what you expect. (Sometimes text files can be saved with different encodings, which may throw drivers off).
It might also be a good idea to create a small, self-contained test case to see if others can reproduce the issue.
Finally, try updating your video drivers, as they seem to be out of date (Ati has released a 4.1 driver).
Yes, shouldnt make a difference, but its not a small program (over 400 cs files in all) so its not straight forward to fully isolate the problem, but I’ll see if I can reproduce the effect in a smaller test case. Since its an innocuous struct defined between others that arent presenting problems I suspect it may be a memory problem in the driver, or something. I might try reording to see if its just the unlucky one!