SPIRV-Cross/reference/shaders-msl/comp/argument-buffers-discrete.msl2.argument.discrete.comp
2019-09-24 18:13:04 -04:00

43 lines
743 B
Plaintext

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct SSBO3
{
float4 v;
};
struct SSBO0
{
float4 v;
};
struct SSBO1
{
float4 v;
};
struct SSBO2
{
float4 v;
};
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
struct spvDescriptorSetBuffer0
{
const device SSBO0* ssbo0 [[id(0)]];
};
struct spvDescriptorSetBuffer1
{
const device SSBO1* ssbo1 [[id(0)]];
};
kernel void main0(constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], constant spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]], device SSBO3& ssbo3 [[buffer(2)]], const device SSBO2& ssbo2 [[buffer(3)]])
{
ssbo3.v = ((*spvDescriptorSet0.ssbo0).v + (*spvDescriptorSet1.ssbo1).v) + ssbo2.v;
}