Skip to content

wgsl: validate loop statement #1666

@dj2

Description

@dj2
  • loop {}
  • loop { continuing {} }
  • loop { is invalid
  • loop } is invalid
  • loop { continuing { } is invalid
  • loop { continuing }} is invalid
  • loop { var a = 1; }
  • loop { var a = 1; continuing { a += 1; } } (var in body is visible in continuing)
  • loop { continuing {} var a = 1; } (invalid continuing must be last)
  • loop { break; }
  • loop { continue; }
  • loop { continue; continuing { }}
  • loop { discard; }
  • loop { continuing { if (true) { break; } }} (invalid, just break if)
  • loop { continuing { break if true; }}
  • loop { continuing { break if (true); }}
  • loop { continuing { discard; } }
  • loop { continuing { if (true) { discard; }}}
  • fn a() { discard;} ... loop { continuing { a(); }}
  • loop { continuing { continue; }} invalid (can't continue inside continuing)
  • loop { continuing { return; }} invalid
  • loop { continuing { if (true) { return; }}} invalid
  • loop { return; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Open (no TODO)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions