Sitelet https://github.com/gpuweb/gpuweb/issues/1911
Skip to content

WGSL: Allow global let-declarations initialized with constant expressions #1911

Description

@Jiawei-Shao

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;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wgslWebGPU Shading Language Issues

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions