-
Notifications
You must be signed in to change notification settings - Fork 363
Open
Labels
copyeditingPure editorial stuff (copyediting, *.bs file syntax, etc.)Pure editorial stuff (copyediting, *.bs file syntax, etc.)wgslWebGPU Shading Language IssuesWebGPU Shading Language Issues
Milestone
Description
The spec is not entirely consistent with how parameterizations of built-in functions are presented. For example, the value constructors for mat2x2 have some of the following overloads:
@const @must_use fn mat2x2<T>(e : mat2x2<S>) -> mat2x2<T>
@const @must_use fn mat2x2(e : mat2x2<S>) -> mat2x2<S>
// T is f32 or f16
// S is AbstractFloat, f32, or f16
@const @must_use fn mat2x2<T>(v1 : vec2<T>, v2 : vec2<T>) -> mat2x2<T>
@const @must_use fn mat2x2(v1 : vec2<T>, v2 : vec2<T>) -> mat2x2<T>
// T is AbstractFloat, f32, or f16
In the first overloads S being AbstractFloat is superfluous since automatic type concretization would occur.
In the second set, mat2x2<AbstractFloat> cannot be typed in WGSL.
The spec should be consistent about how built-in functions are presented. We should answer the following questions:
- Should only required built-in function parameterization be listed? My preference would be yes.
- For abstract types, should we eliminate overloads that cannot be typed? Note that
mat2x2<AbstractFloat>is required for parameter type rules.
After deciding those questions (and any others that might arise) we should do a pass over the spec to make it consistent.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
copyeditingPure editorial stuff (copyediting, *.bs file syntax, etc.)Pure editorial stuff (copyediting, *.bs file syntax, etc.)wgslWebGPU Shading Language IssuesWebGPU Shading Language Issues