这是indexloc提供的服务,不要输入任何密码
Skip to content

The set of functions which have to be imported seems arbitrary #640

@litherum

Description

@litherum

Functions which don't have to be imported:

  • bitReverse()
  • bitCount()
  • any()
  • all()
  • dPdx()
  • dPdy()

Functions which have to be imported:

  • abs()
  • sqrt()
  • max()
  • normalize()
  • length()
  • distance()

As I understand it, the determination of which functions have to be imported is a reflection of common functionality between the OpenCL C Language and GLSL. For a developer writing their WGSL by hand, with either no background or a background in HLSL or MSL, this determination seems arbitrary and meaningless.

We should consider simply listing every function in the the WGSL standard library in the spec, and not requiring WGSL authors to import anything.

Another potential benefit is that it frees up the :: syntax which we may want to use in the future (e.g. to maybe perhaps one day add user-defined namespacing to the language).

Related: #600 "WGSL needs a plan for expansion"

Metadata

Metadata

Assignees

No one assigned

    Labels

    wgslWebGPU Shading Language Issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions