31 lines
460 B
Plaintext
31 lines
460 B
Plaintext
#version 450
|
|
layout(local_size_x = 1) in;
|
|
|
|
struct Sub
|
|
{
|
|
float f[2];
|
|
vec2 f2[2];
|
|
vec3 f3[2];
|
|
vec4 f4[2];
|
|
};
|
|
|
|
layout(std140, binding = 0) buffer SSBO
|
|
{
|
|
Sub sub[2];
|
|
};
|
|
|
|
void main()
|
|
{
|
|
Sub foo = sub[gl_WorkGroupID.x];
|
|
|
|
foo.f[gl_GlobalInvocationID.x] += 1.0;
|
|
foo.f2[gl_GlobalInvocationID.x] += 2.0;
|
|
foo.f3[gl_GlobalInvocationID.x] += 3.0;
|
|
foo.f4[gl_GlobalInvocationID.x] += 4.0;
|
|
sub[gl_WorkGroupID.x] = foo;
|
|
|
|
sub[0].f[0] += 5.0;
|
|
sub[0].f2[1] += 5.0;
|
|
}
|
|
|