third_party/spirv-cross/reference/shaders-msl-no-opt/asm/comp/storage-buffer-pointer-argument.asm.comp
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 SSBO |
| 9 | { |
| 10 | float a; |
| 11 | }; |
| 12 | |
| 13 | struct SSBORead |
| 14 | { |
| 15 | float b; |
| 16 | }; |
| 17 | |
| 18 | static inline __attribute__((always_inline)) |
| 19 | void copy_out(device float& A, device const float& B) |
| 20 | { |
| 21 | A = B; |
| 22 | } |
| 23 | |
| 24 | kernel void main0(device SSBO& _7 [[buffer(0)]], const device SSBORead& _9 [[buffer(1)]]) |
| 25 | { |
| 26 | copy_out(_7.a, _9.b); |
| 27 | } |
| 28 |