Skip to content

Conversation

@nmwsharp
Copy link
Owner

No description provided.

@nmwsharp
Copy link
Owner Author

This does not work currently. The glsl isinf() and isnan() functions are not consistently working as expected across various platforms (observed on macOS M3 Pro openGL version: 4.1 Metal - 88.1).

For now, this cannot be merged, but if anyone knows more about crossplatform glsl and wants to suggest a fix that would be welcome!

@Gaalve
Copy link

Gaalve commented Aug 19, 2025

Checkout: https://sakibsaikia.github.io/graphics/2022/01/04/Nan-Checks-In-HLSL.html

GLSL also uses IEE-754 for floating point representation. See: https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)

If you check for mantissa and exponent bits:
All 8 exponent bits as 1 + all mantissa bits as 0 signify inf,
while all 8 exponent bits as 1 + non-zero mantissa signify nan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants