Currently if a builtin isn't hard-coded it could break shaders (for example, fwidth not being listed might get mangled to fwidth_2_1). As WebGL2 and new extensions come to browsers, we should be wary of new functions/constants.
Some things not listed in the built-ins:
- pragmas like
GL_ES and __VERSION__ -- not sure if that matters tho
- gl_MaxFragmentUniformVectors, gl_MaxVaryingVectors, gl_MaxVertexUniformVectors
- I added dFdx / dFdy, but there is also fwidth
- transpose (GLES 3)
Some other things like gl_InstanceID, gl_ClipDistance, outerProduct, shadow2DProj, etc may or may not eventually end up in WebGL (in spec or through extensions).
Maybe there is another way of handling this? Like only mangling function names when necessary?
Currently if a builtin isn't hard-coded it could break shaders (for example,
fwidthnot being listed might get mangled tofwidth_2_1). As WebGL2 and new extensions come to browsers, we should be wary of new functions/constants.Some things not listed in the built-ins:
GL_ESand__VERSION__-- not sure if that matters thoSome other things like gl_InstanceID, gl_ClipDistance, outerProduct, shadow2DProj, etc may or may not eventually end up in WebGL (in spec or through extensions).
Maybe there is another way of handling this? Like only mangling function names when necessary?