xref: /aosp_15_r20/external/skia/tests/sksl/shared/StaticSwitchWithConditionalBreakInsideBlock.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            {
20              (*_stageOut).sk_FragColor = vec4<f32>(value);
21              break;
22            }
23          }
24          // fallthrough
25        }
26        value = 1.0;
27      }
28      case default {}
29    }
30  }
31}
32@fragment fn main() -> FSOut {
33  var _stageOut: FSOut;
34  _skslMain(&_stageOut);
35  return _stageOut;
36}
37