xref: /aosp_15_r20/external/skia/tests/sksl/shared/StaticSwitchWithConditionalBreak.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  unknownInput: f32,
8};
9@binding(0) @group(0) var<uniform> _globalUniforms: _GlobalUniforms;
10fn _skslMain(_stageOut: ptr<function, FSOut>) {
11  {
12    var value: f32 = 0.0;
13    switch 0 {
14      case 0, 1 {
15        var _skTemp0: bool = false;
16        if 0 == 0 {
17          value = 0.0;
18          if _globalUniforms.unknownInput == 2.0 {
19            break;
20          }
21          // fallthrough
22        }
23        value = 1.0;
24      }
25      case default {}
26    }
27    (*_stageOut).sk_FragColor = vec4<f32>(value);
28  }
29}
30@fragment fn main() -> FSOut {
31  var _stageOut: FSOut;
32  _skslMain(&_stageOut);
33  return _stageOut;
34}
35