xref: /aosp_15_r20/external/skia/tests/sksl/shared/ArrayConstructors.wgsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1diagnostic(off, derivative_uniformity);
2diagnostic(off, chromium.unreachable_code);
3struct FSOut {
4  @location(0) sk_FragColor: vec4<f32>,
5};
6struct _GlobalUniforms {
7  colorGreen: vec4<f32>,
8  colorRed: vec4<f32>,
9};
10@binding(0) @group(0) var<uniform> _globalUniforms: _GlobalUniforms;
11fn _skslMain(coords: vec2<f32>) -> vec4<f32> {
12  {
13    const test1: array<f32, 4> = array<f32, 4>(1.0, 2.0, 3.0, 4.0);
14    const test2: array<vec2<f32>, 2> = array<vec2<f32>, 2>(vec2<f32>(1.0, 2.0), vec2<f32>(3.0, 4.0));
15    const test3: array<mat4x4<f32>, 1> = array<mat4x4<f32>, 1>(mat4x4<f32>(16.0, 0.0, 0.0, 0.0, 0.0, 16.0, 0.0, 0.0, 0.0, 0.0, 16.0, 0.0, 0.0, 0.0, 0.0, 16.0));
16    return select(_globalUniforms.colorRed, _globalUniforms.colorGreen, vec4<bool>(((test1[3] + test2[1].y) + test3[0][3].w) == 24.0));
17  }
18}
19@fragment fn main() -> FSOut {
20  var _stageOut: FSOut;
21  _stageOut.sk_FragColor = _skslMain(/*fragcoord*/ vec2<f32>());
22  return _stageOut;
23}
24