xref: /aosp_15_r20/external/skia/tests/sksl/folding/SelfAssignment.wgsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1diagnostic(off, derivative_uniformity);
2diagnostic(off, chromium.unreachable_code);
3struct _GlobalUniforms {
4  colorRed: vec4<f32>,
5  colorGreen: vec4<f32>,
6};
7@binding(0) @group(0) var<uniform> _globalUniforms: _GlobalUniforms;
8struct S {
9  i: f32,
10  j: f32,
11};
12fn _skslMain(coords: vec2<f32>) -> vec4<f32> {
13  {
14    var x: vec4<f32> = vec4<f32>(3.0, 2.0, 1.0, 0.0);
15    x = vec4<f32>((x.zyx), x.w);
16    var s: S;
17    s.i = 2.0;
18    s.j = 2.0;
19    s.i = s.j;
20    s.j = s.i;
21    var a: array<f32, 2>;
22    a[0] = 1.0;
23    a[1] = 0.0;
24    a[1] = a[0];
25    return vec4<f32>(x.w, s.i / s.j, a[0] - a[1], a[0] * a[1]);
26  }
27}
28@fragment fn main(@location(0) _coords: vec2<f32>) -> @location(0) vec4<f32> {
29  return _skslMain(_coords);
30}
31