bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-in.txt

22 lines
350 B
Text
Raw Normal View History

2014-10-11 15:32:43 -04:00
#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];
}
}