Overlay: Fix vertex discard issue on Nvidia hardware

Instead of relying on undefined behavior to discard the line, we put the
vertex at the camera origin so that interpolation does not produce any
fragment. We don't use FLT_MAX as it also gives unpredicatble results on
NVidia.
This commit is contained in:
2019-12-02 19:02:51 +01:00
parent df29e9c070
commit 1e480840a2

View File

@@ -104,8 +104,8 @@ void main()
gl_Position = point_world_to_ndc(wpos);
if (get_edge_sharpness(wd) < 0.0) {
/* Discard primitive. */
gl_Position = vec4(0.0);
/* Discard primitive by placing any of the verts at the camera origin. */
gl_Position = vec4(0.0, 0.0, -3e36, 0.0);
}
#ifndef SELECT_EDGES