Skip to main content

Module ctor

Module ctor 

Source
Expand description

Constructor implementations, including zero-value constructors.

Functions bear the same name as the WGSL counterpart. Functions that take template parameters are suffixed with _t and take tplt_* arguments.

§Usage quirks

  • The arguments must be loaded.
  • The struct constructor is a bit special since it is the only user-defined type. Use struct_ctor and typecheck_struct_ctor for structs.
  • User-defined functions can shadow WGSL built-in functions.
  • Type aliases must be resolved: WGSL allows calling functions with the name of the alias.

Functions§

array
array() constructor.
array_t
array<T,N>() constructor.
bool
bool() constructor.
f16
f16() constructor.
f32
f32() constructor.
f64
f64() constructor (naga extension).
i32
i32() constructor.
i64
i64() constructor (naga extension).
is_ctor
Check if a function name could correspond to a built-in constructor function.
mat
matCxR() constructor.
mat_t
matCxR<T>() constructor.
struct_ctor
User-defined struct constructor.
type_ctor
Compute the return type of calling a built-in constructor function.
typecheck_struct_ctor
Check a struct constructor call signature.
u32
u32() constructor.
u64
u64() constructor (naga extension).
vec
vecN() constructor.
vec_t
vecN<T>() constructor.