KhronosGroup / KhronosGroup/glslang
Not all built-in functions can portably return a const.
Open
enhancement
GLSL/ESSL
- Dominant language
- C++
- Stars
- 3.6k
- Forks
- 989
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 31
Description
Khronos made an explicit whitelist of which built-in functions, when given constant arguments, must be semantically constant when parsing. This list is below. Glslang can help portability by
1. ensuring all of these can be semantically constant
2. giving warnings on any others that get used in a context requiring a semantic constant
### Angle and Trigonometric Functions
radians
degrees
sin
cos
asin
acos
### Exponential Functions
pow
exp
log
exp2
log2
sqrt
inversesqrt
### Common Functions
abs
sign
floor
trunc
round
ceil
mod
min
max
clamp
### Geometric Functions
length
dot
normalize
Contributor guide
Assessment
This issue has not been assessed yet.