xref: /aosp_15_r20/external/skia/tests/sksl/shared/UniformArray.wgsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1### Compilation failed:
2
3error: Tint compilation failed.
4
5diagnostic(off, derivative_uniformity);
6diagnostic(off, chromium.unreachable_code);
7struct FSOut {
8  @location(0) sk_FragColor: vec4<f32>,
9};
10struct _GlobalUniforms {
11  testArray: array<f32, 5>,
12  colorGreen: vec4<f32>,
13  colorRed: vec4<f32>,
14};
15@binding(0) @group(0) var<uniform> _globalUniforms: _GlobalUniforms;
16fn _skslMain(coords: vec2<f32>) -> vec4<f32> {
17  {
18    {
19      var index: i32 = 0;
20      loop {
21        {
22          if _globalUniforms.testArray[index] != f32(index + 1) {
23            {
24              return _globalUniforms.colorRed;
25            }
26          }
27        }
28        continuing {
29          index = index + i32(1);
30          break if index >= 5;
31        }
32      }
33    }
34    return _globalUniforms.colorGreen;
35  }
36}
37@fragment fn main() -> FSOut {
38  var _stageOut: FSOut;
39  _stageOut.sk_FragColor = _skslMain(/*fragcoord*/ vec2<f32>());
40  return _stageOut;
41}
42
431 error
44