for statement is made up of:
- optional initializer
- optional condition
- optional continuing
The initializer, condition and continuing are each separated by a
for statement requires parentheses.
Braces are required around the
All loops in WGSL must terminate.
As with other statement conditions, if provided, the condition must be a boolean expression.
The condition is evaluated before executing the body on each iteration.
If the condition is
false the loop will end.
break statement can be used to break out of the closest enclosing
continue statement can be used to go to the next iteration
of the enclosing loop.