Resolve a shader given as either a string or function.

  • Parameters

    • shader: any

      A shader string, or a function that returns one when given the context and state arguments.

    • Optionalcontext: any

      A context passed to shader if it's a function.

    • Optionalstate: any

      A state passed to shader if it's a function.

    Returns string

    The given shader if it's a string; otherwise if it's a function the string returned by calling it with context and state.