2018-04-10 18:46:39 +02:00
|
|
|
#version 450
|
|
|
|
|
2021-02-21 02:20:14 +01:00
|
|
|
layout(constant_id = 1) const bool s_gamma_bound = true;
|
2019-03-24 18:02:19 +01:00
|
|
|
|
2019-04-03 17:39:13 +02:00
|
|
|
layout(binding = 0) uniform sampler2D s_image;
|
|
|
|
layout(binding = 1) uniform sampler1D s_gamma;
|
2018-04-13 13:47:15 +02:00
|
|
|
|
2018-04-10 18:46:39 +02:00
|
|
|
layout(location = 0) in vec2 i_texcoord;
|
|
|
|
layout(location = 0) out vec4 o_color;
|
|
|
|
|
|
|
|
void main() {
|
2019-04-03 17:39:13 +02:00
|
|
|
o_color = texture(s_image, i_texcoord);
|
2018-04-12 13:38:22 +02:00
|
|
|
|
2021-02-21 02:20:14 +01:00
|
|
|
if (s_gamma_bound) {
|
2019-03-24 18:02:19 +01:00
|
|
|
o_color = vec4(
|
2019-04-03 17:39:13 +02:00
|
|
|
texture(s_gamma, o_color.r).r,
|
|
|
|
texture(s_gamma, o_color.g).g,
|
|
|
|
texture(s_gamma, o_color.b).b,
|
2019-03-24 18:02:19 +01:00
|
|
|
o_color.a);
|
|
|
|
}
|
2018-04-10 18:46:39 +02:00
|
|
|
}
|