Debian Codegraph @

third_party/spirv-cross/reference/shaders-msl/asm/frag/extract-packed-from-composite.asm.frag

raw
1 #pragma clang diagnostic ignored "-Wmissing-prototypes"
2
3 #include <metal_stdlib>
4 #include <simd/simd.h>
5
6 using namespace metal;
7
8 struct Foo
9 {
10 float3 a;
11 float b;
12 };
13
14 struct Foo_1
15 {
16 packed_float3 a;
17 float b;
18 };
19
20 struct buf
21 {
22 Foo_1 results[16];
23 float4 bar;
24 };
25
26 struct main0_out
27 {
28 float4 _entryPointOutput [[color(0)]];
29 };
30
31 static inline __attribute__((always_inline))
32 float4 _main(thread const float4& pos, constant buf& v_11)
33 {
34 int _46 = int(pos.x) % 16;
35 Foo foo;
36 foo.a = float3(v_11.results[_46].a);
37 foo.b = v_11.results[_46].b;
38 return float4(dot(foo.a, v_11.bar.xyz), foo.b, 0.0, 0.0);
39 }
40
41 fragment main0_out main0(constant buf& v_11 [[buffer(0)]], float4 gl_FragCoord [[position]])
42 {
43 main0_out out = {};
44 float4 pos = gl_FragCoord;
45 float4 param = pos;
46 out._entryPointOutput = _main(param, v_11);
47 return out;
48 }
49