gl_ClipDistance[] in Tesselation Ev. Shader, NVIDI

Hi!
I’m using OpenGL 4.1 on a NVIDIA GeForce 460 for a demo, and I use tesselation which works fine. But now I tried to add a clipping plane to the shader program, so I wrote in the Tesselation Evaluation Shader:


#version 410 core
(..)
void main()
{
(...)
gl_ClipDistance[0] = dot((Model_TransformMatrix * vec4(my_ObjPosition, 1.0)).xyz, vec3(0, -1, 0));
(...)
}

With this command, the shader error throws an error “gl_ClipDistance is not available in this profile”. Maybe I missunderstood the specification, so I tried another variant:


#version 410 core
(..)
void main()
{
(...)
gl_PerVertex.gl_ClipDistance[0] = dot((Model_TransformMatrix * vec4(my_ObjPosition, 1.0)).xyz, vec3(0, -1, 0));
(...)
}

Now the compiler throws syntax errors:


0(59) : error C0000: syntax error, unexpected '.', expecting ';' or '(' at token "."
0(59) : error C0501: type name expected at token "."
0(59) : error C1043: size of dimension cannot be less than 1
0(59) : error C1060: incompatible types in initialization
0(59) : error C1056: invalid initialization

Is this my fault, is there an other way to define the clipping plane? Or is it a driver bug?

Greetings,
Christian M

edit: I’m using driver version 260.19.36 under linux, but also tried the latest 266.58 under windows 7.

So your first code quote:


gl_ClipDistance[0] = dot((Model_TransformMatrix * vec4(my_ObjPosition, 1.0)).xyz, vec3(0, -1, 0));

should have worked. File a bug with NVIDIA. Quite some time ago, I had trouble with gl_ClipDistance in GL3.x (under GeForce8/9/100/200) and when I filed the bug report it was fixed very quickly.