dawn-cmake/test/tint/bug/tint/1321.wgsl.expected.glsl
Ben Clayton 3cde73cb1a tint/transform/utils: Correctly scope for-loop init
When using HoistToDeclBefore on a for-loop initializer, the inserted
statement would be scoped outside the for-loop. This was incorrect.

Change-Id: I764d07068e907cc203145ac8d6f0110b1b73e667
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122301
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Kokoro: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-03-02 17:18:27 +00:00

26 lines
345 B
GLSL

#version 310 es
precision mediump float;
int foo() {
return 1;
}
void tint_symbol() {
float arr[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f);
{
int tint_symbol_1 = foo();
int a_save = tint_symbol_1;
while (true) {
{
float x = arr[a_save];
break;
}
}
}
}
void main() {
tint_symbol();
return;
}