1
0
mirror of https://github.com/EduApps-CDG/OpenDX synced 2024-12-30 09:45:37 +01:00
OpenDX/src/dxvk/shaders/dxvk_present_frag.frag
Philip Rebohle 49f2b4c4a6 [dxvk] Introduce DxvkSwapchainBlitter and new presentation shaders
This is meant to provide a common rendering code for D3D9 and D3D11 presentation.
2021-02-27 14:54:14 +00:00

27 lines
601 B
GLSL

#version 450
layout(constant_id = 1) const bool s_gamma_bound = true;
layout(binding = 0) uniform sampler2D s_image;
layout(binding = 1) uniform sampler1D s_gamma;
layout(location = 0) out vec4 o_color;
layout(push_constant)
uniform present_info_t {
ivec2 src_offset;
ivec2 dst_offset;
};
void main() {
ivec2 coord = ivec2(gl_FragCoord.xy) + src_offset - dst_offset;
o_color = texelFetch(s_image, coord, 0);
if (s_gamma_bound) {
o_color = vec4(
texture(s_gamma, o_color.r).r,
texture(s_gamma, o_color.g).g,
texture(s_gamma, o_color.b).b,
o_color.a);
}
}