xref: /aosp_15_r20/external/skia/tests/sksl/shared/VectorConstructors.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  unknownInput: f32,
10};
11@binding(0) @group(0) var<uniform> _globalUniforms: _GlobalUniforms;
12fn check_bf2f2f2f3i2i2f2f2f4i2b4f2f2f2b2b2b3i4(v1: vec2<f32>, v2: vec2<f32>, v3: vec2<f32>, v4: vec3<f32>, v5: vec2<i32>, v6: vec2<i32>, v7: vec2<f32>, v8: vec2<f32>, v9: vec4<f32>, v10: vec2<i32>, v11: vec4<bool>, v12: vec2<f32>, v13: vec2<f32>, v14: vec2<f32>, v15: vec2<bool>, v16: vec2<bool>, v17: vec3<bool>, v18: vec4<i32>) -> bool {
13  {
14    return (((((((((((((((((f32(v1.x) + f32(v2.x)) + f32(v3.x)) + f32(v4.x)) + f32(v5.x)) + f32(v6.x)) + f32(v7.x)) + f32(v8.x)) + f32(v9.x)) + f32(v10.x)) + f32(v11.x)) + f32(v12.x)) + f32(v13.x)) + f32(v14.x)) + f32(v15.x)) + f32(v16.x)) + f32(v17.x)) + f32(v18.x)) == 18.0;
15  }
16}
17fn _skslMain(coords: vec2<f32>) -> vec4<f32> {
18  {
19    const v1: vec2<f32> = vec2<f32>(1.0);
20    const v2: vec2<f32> = vec2<f32>(1.0, 2.0);
21    const v3: vec2<f32> = vec2<f32>(1.0);
22    const v4: vec3<f32> = vec3<f32>(1.0);
23    const v5: vec2<i32> = vec2<i32>(1);
24    const v6: vec2<i32> = vec2<i32>(1, 2);
25    const v7: vec2<f32> = vec2<f32>(1.0, 2.0);
26    let v8: vec2<f32> = vec2<f32>(v5);
27    let v9: vec4<f32> = vec4<f32>(f32(v6.x), _globalUniforms.unknownInput, 3.0, 4.0);
28    let v10: vec2<i32> = vec2<i32>(3, i32(v1.x));
29    const v11: vec4<bool> = vec4<bool>(true, false, true, false);
30    const v12: vec2<f32> = vec2<f32>(1.0, 0.0);
31    const v13: vec2<f32> = vec2<f32>(0.0);
32    const v14: vec2<f32> = vec2<f32>(0.0);
33    const v15: vec2<bool> = vec2<bool>(true);
34    const v16: vec2<bool> = vec2<bool>(true);
35    const v17: vec3<bool> = vec3<bool>(true);
36    const v18: vec4<i32> = vec4<i32>(1);
37    var _skTemp0: vec4<f32>;
38    let _skTemp1 = check_bf2f2f2f3i2i2f2f2f4i2b4f2f2f2b2b2b3i4(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18);
39    if _skTemp1 {
40      _skTemp0 = _globalUniforms.colorGreen;
41    } else {
42      _skTemp0 = _globalUniforms.colorRed;
43    }
44    return _skTemp0;
45  }
46}
47@fragment fn main() -> FSOut {
48  var _stageOut: FSOut;
49  _stageOut.sk_FragColor = _skslMain(/*fragcoord*/ vec2<f32>());
50  return _stageOut;
51}
52