Current WGSL SPEC only allow global let-declarations initialized with const_expr, and const_expr only accepts const_literal.
It would be convenient for developers to support initializing global let-declarations with "constant expressions" not just "constant numbers". For example, the following WGSL expressions will become valid after WGSL supports initializing global let-declarations with "constant expressions":
let size: u32 = 4u * 5u;
let a: u32 = 4u;
let b: u32 = a;
Current WGSL SPEC only allow global let-declarations initialized with
const_expr, andconst_expronly acceptsconst_literal.It would be convenient for developers to support initializing global
let-declarations with "constant expressions" not just "constant numbers". For example, the following WGSL expressions will become valid after WGSL supports initializing globallet-declarations with "constant expressions":