这是indexloc提供的服务,不要输入任何密码
Skip to content

Consider adding sugar for familiar loop constructs #569

@Kangz

Description

@Kangz

The loop { continue { } } control flow construct of WGSL isn't present in an other language that I know of and makes writing simple loops more verbose than familiar for-loops. We should consider adding sugar for example:

for (<init-statement>; <condition-expr>; <continue-statement>) {
    <body-statements>
}

could be desugared to

{
    <init-statement>
    loop {
        break if <condition-expr>;
        <body-statements>
        continue {
            <continue-statement>;
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    wgslWebGPU Shading Language Issueswgsl resolvedResolved - waiting for a change to the WGSL specification

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions