OpenGL-Refpages icon indicating copy to clipboard operation
OpenGL-Refpages copied to clipboard

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

Open johnstiles-google opened this issue 9 months ago • 0 comments

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).

johnstiles-google avatar May 20 '24 12:05 johnstiles-google