]> git.sesse.net Git - movit/blob - footer.comp
Install compute shaders on make install.
[movit] / footer.comp
1 // GLSL is pickier than the C++ preprocessor in if-testing for undefined
2 // tokens; do some fixups here to keep it happy.
3
4 #ifndef SQUARE_ROOT_TRANSFORMATION
5 #define SQUARE_ROOT_TRANSFORMATION 0
6 #endif
7
8 void main()
9 {
10         INPUT();
11 }
12
13 vec4 tex2D(sampler2D s, vec2 coord)
14 {
15         return texture(s, coord);
16 }
17
18 void cs_output(uvec2 coord, vec4 val)
19 {
20         cs_output(ivec2(coord), val);
21 }
22
23 void cs_output(ivec2 coord, vec4 val)
24 {
25 #if SQUARE_ROOT_TRANSFORMATION
26         // Make sure we don't give negative values to sqrt.
27         val.rgb = sqrt(max(val.rgb, 0.0));
28 #endif
29         imageStore(outbuf, coord, val);
30 }