mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-08 06:05:55 +00:00
When converting a for-loop to a loop, we were not cloning the for-loop's body, but rather the statements within it. This worked fine, except if we also hoisted a variable to a let within that body, which requires the body to be cloned for the 'insert before' to work. This change clones the for-loop body, which fixes the problem, but introduces a block in the destination AST, which is ugly, but not incorrect. Bug: tint:1300 Change-Id: I478244d87f8cf58837102004242ba1c835e21710 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/78821 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
23 lines
328 B
GLSL
23 lines
328 B
GLSL
#version 310 es
|
|
precision mediump float;
|
|
|
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
|
void unused_entry_point() {
|
|
return;
|
|
}
|
|
void f() {
|
|
int i = 0;
|
|
while (true) {
|
|
if (!(false)) {
|
|
break;
|
|
}
|
|
{
|
|
}
|
|
{
|
|
int tint_symbol[1] = int[1](1);
|
|
i = (i + tint_symbol[0]);
|
|
}
|
|
}
|
|
}
|
|
|