mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-04 19:25:47 +00:00
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>
26 lines
345 B
GLSL
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;
|
|
}
|