summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/shaders/backingstorecompose.frag
blob: e0c419840e41066bf2c97cb4d5e0ec21eea31d2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#version 440

layout(location = 0) in vec2 v_texcoord;
layout(location = 0) out vec4 fragColor;

layout(std140, binding = 0) uniform buf {
    mat4 vertexTransform;
    mat3 textureTransform;
    float opacity;
    int swapRedBlue;
};

layout(binding = 1) uniform sampler2D textureSampler;

void main()
{
    vec4 tmpFragColor = texture(textureSampler, v_texcoord);
    tmpFragColor.a *= opacity;
    if (swapRedBlue == 0)
        fragColor = tmpFragColor;
    else
        fragColor = tmpFragColor.bgra;
}