KhronosGroup / KhronosGroup/GLSL

suggested intBitsToFloat() clarification

Open
#133 2 comments 0 reactions 1 assignee Claimed by @johnkslang View on GitHub
Resolving Inside Khronos
Dominant language
JavaScript
Stars
458
Forks
114
Avg merge
4m
Merged PRs (30d)
1

Description

The docs already mention that passing bits that produce NaN results in undefined results. A case that isn't mentioned though is passing bits that produce a denormalized float, which would be incredibly common when working with bitmasks or just integers you want to store in a float output. Since 4.7.1 states that denormalized floats can be flushed to 0 after any operation, I would assume this includes intBitsToFloat(). Both AMD and Intel GPUs seem to suffer from this case, where intBitsToFloat(0x1) results in 0x0 in the output buffer.
Since a user of intBitsToFloat() would be particularly concerned with cases like this, I think it would be helpful if the denormalized caveat was also mentioned.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.