KhronosGroup / KhronosGroup/glslang

Not all built-in functions can portably return a const.

Open
#925 4 comments 0 reactions 1 assignee Claimed by @johnkslang View on GitHub
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

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.