glslify / glslify/glsl-tokenizer

Approach to built-ins

Open
#3 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
52
Forks
8
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.