#include "/lib/all_the_libs.glsl"

layout(local_size_x = 1, local_size_y = 1) in;

const vec2 workGroupsRender = vec2(0.015625, 0.015625);
const vec2 SAMPLE_OFFSET = vec2(0.25);
const vec2 OFFSET = vec2(0.3125);
#include "/generic/post/bloom.glsl"

void main() {
    ivec2 GlobalPos = ivec2(gl_GlobalInvocationID.xy);

    vec2 SamplePos = GlobalPos * resolutionInv * 4 + SAMPLE_OFFSET;
    vec3 Color = read_blurred_bloom(SamplePos, true);
    write_bloom(GlobalPos + ivec2(OFFSET * resolution), Color, false);
}
