Debian Codegraph @

third_party/spirv-cross/reference/shaders-msl-no-opt/comp/loop.comp

raw
1 #include <metal_stdlib>
2 #include <simd/simd.h>
3
4 using namespace metal;
5
6 struct SSBO
7 {
8 float4x4 mvp;
9 float4 in_data[1];
10 };
11
12 struct SSBO2
13 {
14 float4 out_data[1];
15 };
16
17 constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
18
19 kernel void main0(const device SSBO& _24 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
20 {
21 uint ident = gl_GlobalInvocationID.x;
22 float4 idat = _24.in_data[ident];
23 int k = 0;
24 uint i = 0u;
25 if (idat.y == 20.0)
26 {
27 do
28 {
29 k *= 2;
30 i++;
31 } while (i < ident);
32 }
33 switch (k)
34 {
35 case 10:
36 {
37 for (;;)
38 {
39 i++;
40 if (i > 10u)
41 {
42 break;
43 }
44 continue;
45 }
46 break;
47 }
48 default:
49 {
50 for (;;)
51 {
52 i += 2u;
53 if (i > 20u)
54 {
55 break;
56 }
57 continue;
58 }
59 break;
60 }
61 }
62 while (k < 10)
63 {
64 idat *= 2.0;
65 k++;
66 }
67 for (uint i_1 = 0u; i_1 < 16u; i_1++, k++)
68 {
69 for (uint j = 0u; j < 30u; j++)
70 {
71 idat = _24.mvp * idat;
72 }
73 }
74 k = 0;
75 for (;;)
76 {
77 k++;
78 if (k > 10)
79 {
80 k += 2;
81 }
82 else
83 {
84 k += 3;
85 continue;
86 }
87 k += 10;
88 continue;
89 }
90 }
91