mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-15 20:01:22 +00:00
The generators were not setting `emit_continuing_` when emitting while loops. This caused a crash when a `continue` was encountered. This CL adds the `emit_continuing_` setup to the while emission. It also guards the `emit_continuing_` usage with making sure the function is setup. Bug: tint:1490 Change-Id: Ia89c49e567acda71a1f851a582103723cff71d49 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93960 Commit-Queue: Dan Sinclair <dsinclair@chromium.org> Auto-Submit: Dan Sinclair <dsinclair@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
13 lines
184 B
Plaintext
13 lines
184 B
Plaintext
#include <metal_stdlib>
|
|
|
|
using namespace metal;
|
|
int f() {
|
|
int i = 0;
|
|
while((i < 4)) {
|
|
i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
|
|
continue;
|
|
}
|
|
return i;
|
|
}
|
|
|