bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-in.txt
2014-10-11 12:32:43 -07:00

21 lines
350 B
Text

#define MAX_ITER 5
attribute vec4 a_position;
uniform int u_iter;
uniform vec4 u_deltas[MAX_ITER];
int my_min(int a, int b) {
if (a < b) {
return a;
} else {
return b;
}
}
void main() {
gl_Position = a_position;
for (int i = 0; i < my_min(u_iter, MAX_ITER); i++) {
gl_Position += u_deltas[i];
}
}