Skip to content

Approach to built-ins #3

@mattdesl

Description

@mattdesl

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions