KhronosGroup / OpenGL-Refpages

OpenGL and OpenGL ES reference page sources, and generated HTML used as backing store for khronos.org
439 stars 136 forks source link

OpenGL Reference pages conflict with specifications for `atan` undefined behavior #152

Open johnstiles-google opened 6 months ago

johnstiles-google commented 6 months ago

The Reference pages for atan indicate that "the result is undefined if x=0".

https://registry.khronos.org/OpenGL-Refpages/gl4/html/atan.xhtml

However, the GLSL specification does not match, and for atan it states "results are undefined if x and y are both 0."

https://registry.khronos.org/OpenGL/specs/gl/GLSLangSpec.4.60.pdf

(The Reference page phrasing is also somewhat vague because it has a paragraph specifically about "the second overload"—the one containing an x parameter—but the text about undefined results is not contained in this paragraph.)

FWIW, the SPIR-V definition of Atan2 matches the GLSL specification's text (undefined when x and y are both 0), not the Reference pages text (x=0).