SPIRV-Cross/shaders-msl/comp/composite-construct.comp

32 lines
548 B
Plaintext

#version 310 es
layout(local_size_x = 1) in;
layout(std430, binding = 0) buffer SSBO0
{
vec4 as[];
};
layout(std430, binding = 1) buffer SSBO1
{
vec4 bs[];
};
struct Composite
{
vec4 a;
vec4 b;
};
const vec4 const_values[2] = vec4[](vec4(20.0), vec4(40.0));
void main()
{
vec4 values[2] = vec4[](as[gl_GlobalInvocationID.x], bs[gl_GlobalInvocationID.x]);
vec4 copy_values[2];
copy_values = const_values;
Composite c = Composite(values[0], copy_values[1]);
as[0] = values[gl_LocalInvocationIndex];
bs[1] = c.b;
}