#version 310 es
layout(local_size_x = 1) in;

layout(std430, binding = 0) readonly buffer SSBO
{
    vec4 in_data[];
};

layout(std430, binding = 1) writeonly buffer SSBO2
{
    vec4 out_data[];
};

layout(std430, binding = 2) buffer SSBO3
{
    uint counter;
};

void main()
{
    uint ident = gl_GlobalInvocationID.x;
    vec4 idata = in_data[ident];
    if (dot(idata, vec4(1.0, 5.0, 6.0, 2.0)) > 8.2)
    {
        out_data[atomicAdd(counter, 1u)] = idata;
    }
}

