third_party/spirv-cross/reference/shaders-msl-no-opt/frag/ubo-array-multiple-structs-access-chain.frag
raw| 1 | #include <metal_stdlib> |
| 2 | #include <simd/simd.h> |
| 3 | |
| 4 | using namespace metal; |
| 5 | |
| 6 | struct Foo |
| 7 | { |
| 8 | float4 v; |
| 9 | }; |
| 10 | |
| 11 | struct UBO |
| 12 | { |
| 13 | Foo foo; |
| 14 | }; |
| 15 | |
| 16 | struct main0_out |
| 17 | { |
| 18 | float4 FragColor [[color(0)]]; |
| 19 | }; |
| 20 | |
| 21 | fragment main0_out main0(constant UBO* ubos_0 [[buffer(0)]], constant UBO* ubos_1 [[buffer(1)]]) |
| 22 | { |
| 23 | constant UBO* ubos[] = |
| 24 | { |
| 25 | ubos_0, |
| 26 | ubos_1, |
| 27 | }; |
| 28 | |
| 29 | main0_out out = {}; |
| 30 | out.FragColor = ubos[1]->foo.v; |
| 31 | return out; |
| 32 | } |
| 33 |