#version 450

layout(location = 0) in vec2 fsin_tex;
layout(location = 0) out vec4 fin_color;

layout(binding = 0) uniform sampler2D prev;

layout(push_constant, std430) uniform pc {
    layout(offset = 8) float gamma_correction_factor;
    float hdr_factor;
    float lsd_factor;
    float anim_time;
};

void main() {
    vec2 tex_offset = 1.0 / textureSize(prev, 0);
    vec4 hdr_color = texture(prev, gl_FragCoord.xy * tex_offset);
    fin_color = vec4(vec3(1) - exp(-hdr_factor * hdr_color.xyz), 1);
    // fin_color = hdr_color;
}
