Debian Codegraph @

third_party/spirv-cross/reference/opt/shaders-msl/frag/control-dependent-in-branch.desktop.frag

raw
1 #include <metal_stdlib>
2 #include <simd/simd.h>
3
4 using namespace metal;
5
6 struct main0_out
7 {
8 float4 FragColor [[color(0)]];
9 };
10
11 struct main0_in
12 {
13 float4 vInput [[user(locn0)]];
14 };
15
16 fragment main0_out main0(main0_in in [[stage_in]], texture2d<float> uSampler [[texture(0)]], sampler uSamplerSmplr [[sampler(0)]])
17 {
18 main0_out out = {};
19 out.FragColor = in.vInput;
20 float4 _23 = uSampler.sample(uSamplerSmplr, in.vInput.xy);
21 float4 _26 = dfdx(in.vInput);
22 float4 _29 = dfdy(in.vInput);
23 float4 _32 = fwidth(in.vInput);
24 float4 _35 = dfdx(in.vInput);
25 float4 _38 = dfdy(in.vInput);
26 float4 _41 = fwidth(in.vInput);
27 float4 _44 = dfdx(in.vInput);
28 float4 _47 = dfdy(in.vInput);
29 float4 _50 = fwidth(in.vInput);
30 if (in.vInput.y > 10.0)
31 {
32 out.FragColor += _23;
33 out.FragColor += _26;
34 out.FragColor += _29;
35 out.FragColor += _32;
36 out.FragColor += _35;
37 out.FragColor += _38;
38 out.FragColor += _41;
39 out.FragColor += _44;
40 out.FragColor += _47;
41 out.FragColor += _50;
42 }
43 return out;
44 }
45