#version 460 core #extension GL_ARB_separate_shader_objects : enable #extension GL_ARB_shading_language_420pack : enable // includes #include "common/bloom_common.h" // sets #include "render/shaders/common/render_post_process_layout_common.h" layout(set = 1, binding = 0, rgba16f/*r11f_g11f_b10f*/) uniform readonly image2D uRTex; layout(set = 1, binding = 0, rgba16f/*r11f_g11f_b10f*/) uniform writeonly image2D uWTex; layout(set = 1, binding = 1) uniform texture2D uTex; layout(set = 1, binding = 2) uniform sampler uSampler; /////////////////////////////////////////////////////////////////////////////// // bloom upscale #define cTgs 8 layout(local_size_x = cTgs, local_size_y = cTgs, local_size_z = 1) in; void main() { // texSizeInvTexSize needs to be the output resolution const vec2 uv = (vec2(gl_GlobalInvocationID.xy) + 0.5) * uPc.viewportSizeInvSize.zw; vec3 color = bloomUpscale(uv, uPc.viewportSizeInvSize.zw, uTex, uSampler); const ivec2 coords = ivec2(gl_GlobalInvocationID.xy); const vec3 baseColor = imageLoad(uRTex, coords).xyz; color = min((color + baseColor), CORE_BLOOM_CLAMP_MAX_VALUE); imageStore(uWTex, coords, vec4(color, 1.0)); }