GL_DEPTH_CLAMP doesn't clamp to the far plane
Submitted by Jules Blok
Assigned to mes..@..op.org
Created attachment 125579 apitrace file to reproduce the problem
On both the Intel drivers and the software rasterizer (llvm) GL_DEPTH_CLAMP doesn't properly clamp to the far plane as specified. It seems that it clamps the depth value written to the depth buffer to 1.0 instead.
According to the specs: https://www.opengl.org/registry/specs/ARB/depth_clamp.txt
The one major issue is that fragments of a primitive may extend beyond the conventional window space depth range for depth values (typically the range [0,1]). Rather than discarding fragments that defy the window space depth range (effectively what near and far plane clipping accomplish), the depth values can be clamped to the current depth range.
I've attached an apitrace to reproduce the problem.
Attachment 125579, "apitrace file to reproduce the problem":