GL_DEPTH_CLAMP doesn't clamp to the far plane
Submitted by Jules Blok
Assigned to mes..@..op.org
Description
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.
Expected output: https://fifoci.dolphin-emu.org/media/results/a09836d8de0911b9c6bdceffe64561a54cd988e9.png
Actual output: https://fifoci.dolphin-emu.org/media/results/565273f42d550e19b9b83921f177e4a898bbd5e6.png
Attachment 125579, "apitrace file to reproduce the problem":
DolphinClamp.7z