4 [vertex shader passthrough]
8 Test predication on values from large array
10 Big local arrays may be handled differently than smaller ones, e.g. stored in
11 a global memory. However drivers may have a subtle error combining this
12 optimization with helper invocations of fragment shader.
14 Since all side-effects of helper invocations are being ignored - driver may
15 also erroneously ignore stores to a local array which was lowered to
18 This may cause an issue when a control flow in helper invocation depends
19 on the value written to such array.
21 To test this we make a loop which depends on a value written to a big local
22 array, so if stores are being ignored - the loop will become infinite,
31 uniform int indexInArray;
34 for (int i = 0; i < map.length(); i++) {
38 int i = min(indexInArray, map.length() - 1);
49 gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
53 uniform int indexInArray 500
54 clear color 0.0 0.0 0.0 0.0
56 draw rect -1.0 -1.0 2.0 2.0
57 relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0)