bgfx/3rdparty/spirv-cross/shaders-msl/comp/composite-array-initialization.comp
Бранимир Караџић ac29dccc6a Added spirv-cross.
2019-01-09 19:23:47 -08:00

29 lines
485 B
Plaintext

#version 450
layout(local_size_x = 2) in;
struct Data
{
float a;
float b;
};
layout(std430, binding = 0) buffer SSBO
{
Data outdata[];
};
layout(constant_id = 0) const float X = 4.0;
Data data[2] = Data[](Data(1.0, 2.0), Data(3.0, 4.0));
Data data2[2] = Data[](Data(X, 2.0), Data(3.0, 5.0));
Data combine(Data a, Data b)
{
return Data(a.a + b.a, a.b + b.b);
}
void main()
{
outdata[gl_WorkGroupID.x] = combine(data[gl_LocalInvocationID.x], data2[gl_LocalInvocationID.x]);
}