third_party/spirv-cross/reference/shaders-msl/frag/ubo_layout.frag
raw| 1 | #include <metal_stdlib> |
| 2 | #include <simd/simd.h> |
| 3 | |
| 4 | using namespace metal; |
| 5 | |
| 6 | struct Str |
| 7 | { |
| 8 | float4x4 foo; |
| 9 | }; |
| 10 | |
| 11 | struct UBO1 |
| 12 | { |
| 13 | Str foo; |
| 14 | }; |
| 15 | |
| 16 | struct Str_1 |
| 17 | { |
| 18 | float4x4 foo; |
| 19 | }; |
| 20 | |
| 21 | struct UBO2 |
| 22 | { |
| 23 | Str_1 foo; |
| 24 | }; |
| 25 | |
| 26 | struct main0_out |
| 27 | { |
| 28 | float4 FragColor [[color(0)]]; |
| 29 | }; |
| 30 | |
| 31 | fragment main0_out main0(constant UBO1& ubo1 [[buffer(0)]], constant UBO2& ubo0 [[buffer(1)]]) |
| 32 | { |
| 33 | main0_out out = {}; |
| 34 | out.FragColor = float4(ubo1.foo.foo[0][0], ubo1.foo.foo[1][0], ubo1.foo.foo[2][0], ubo1.foo.foo[3][0]) + ubo0.foo.foo[0]; |
| 35 | return out; |
| 36 | } |
| 37 |