xref: /aosp_15_r20/external/skia/tests/sksl/shared/ConstantCompositeAccessViaConstantIndex.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  colorRed: vec4<f32>,
12  testMatrix2x2: mat2x2<f32>,
13  testArray: array<f32, 5>,
14};
15@binding(0) @group(0) var<uniform> _globalUniforms: _GlobalUniforms;
16const globalArray: array<f32, 5> = array<f32, 5>(1.0, 1.0, 1.0, 1.0, 1.0);
17const globalVector: vec2<f32> = vec2<f32>(1.0);
18const globalMatrix: mat2x2<f32> = mat2x2<f32>(1.0, 1.0, 1.0, 1.0);
19fn _skslMain(_skParam0: vec2<f32>) -> vec4<f32> {
20  {
21    const localArray: array<f32, 5> = array<f32, 5>(0.0, 1.0, 2.0, 3.0, 4.0);
22    const localVector: vec2<f32> = vec2<f32>(1.0);
23    const localMatrix: mat2x2<f32> = mat2x2<f32>(0.0, 1.0, 2.0, 3.0);
24    if ((((((globalArray[0] == _globalUniforms.testArray[0]) && (globalArray[1] == _globalUniforms.testArray[1]) && (globalArray[2] == _globalUniforms.testArray[2]) && (globalArray[3] == _globalUniforms.testArray[3]) && (globalArray[4] == _globalUniforms.testArray[4])) || all(globalVector == _globalUniforms.colorRed.xy)) || (all(globalMatrix[0] == _globalUniforms.testMatrix2x2[0]) && all(globalMatrix[1] == _globalUniforms.testMatrix2x2[1]))) || ((localArray[0] == _globalUniforms.testArray[0]) && (localArray[1] == _globalUniforms.testArray[1]) && (localArray[2] == _globalUniforms.testArray[2]) && (localArray[3] == _globalUniforms.testArray[3]) && (localArray[4] == _globalUniforms.testArray[4]))) || all(localVector == _globalUniforms.colorRed.xy)) || (all(localMatrix[0] == _globalUniforms.testMatrix2x2[0]) && all(localMatrix[1] == _globalUniforms.testMatrix2x2[1])) {
25      {
26        return _globalUniforms.colorRed;
27      }
28    }
29    return vec4<f32>(0.0, 1.0, 0.0, 1.0);
30  }
31}
32@fragment fn main() -> FSOut {
33  var _stageOut: FSOut;
34  _stageOut.sk_FragColor = _skslMain(/*fragcoord*/ vec2<f32>());
35  return _stageOut;
36}
37
381 error
39