| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct SSBO3 |
| 7 |
{ |
| 8 |
float4 v; |
| 9 |
}; |
| 10 |
|
| 11 |
struct SSBO0 |
| 12 |
{ |
| 13 |
float4 v; |
| 14 |
}; |
| 15 |
|
| 16 |
struct SSBO1 |
| 17 |
{ |
| 18 |
float4 v; |
| 19 |
}; |
| 20 |
|
| 21 |
struct SSBO2 |
| 22 |
{ |
| 23 |
float4 v; |
| 24 |
}; |
| 25 |
|
| 26 |
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u); |
| 27 |
|
| 28 |
struct spvDescriptorSetBuffer0 |
| 29 |
{ |
| 30 |
const device SSBO0* ssbo0 [[id(0)]]; |
| 31 |
}; |
| 32 |
|
| 33 |
struct spvDescriptorSetBuffer1 |
| 34 |
{ |
| 35 |
const device SSBO1* ssbo1 [[id(0)]]; |
| 36 |
}; |
| 37 |
|
| 38 |
kernel void main0(constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], constant spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]], device SSBO3& ssbo3 [[buffer(2)]], const device SSBO2& ssbo2 [[buffer(3)]]) |
| 39 |
{ |
| 40 |
ssbo3.v = ((*spvDescriptorSet0.ssbo0).v + (*spvDescriptorSet1.ssbo1).v) + ssbo2.v; |
| 41 |
} |
| 42 |
|