Skip to content

[wgsl] Implicit types for variable declarations with expressions. #560

@dj2

Description

@dj2

This came up at the F2F. Currently all var and const require the type to be supplied. This is redundant in the case where an initializer is provided and we can determine the type.

The proposal at the F2F was to make the type optional. The grammar would become:

var <id> [: <type>]? [= expr]?

Where the type is optional if expr is provided and we can determine it.

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