GLSL link error when using gl_ClipDistance

GLSL link error when using gl_ClipDistance


I have the following problem: I write a simple GLSL program with only a vertex shader which writes into gl_ClipDistance:

#version 130

uniform vec4 clipPlane;

out float gl_ClipDistance[1];

void main()
 gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
 gl_ClipDistance[0] = dot(gl_ModelViewMatrix * gl_Vertex, clipPlane);

 gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;

 gl_FrontColor = gl_Color;
 gl_BackColor = gl_Color;

It compiles without error, but linkage fails with the error "Out of resource error".

When I remove the line writing to gl_ClipDistance, there is no error any more.

There is also no error if a fragment shader is part of the program.

So the link error only occurs when mixing a programmable vertex shader with the fixed functionality for fragments.

The same error also occurs when using gl_ClipVertex.

Thanks in advance.


* Device: Intel HD Graphics 530

* Driver:


1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.