1 // GLSL is pickier than the C++ preprocessor in if-testing for undefined
2 // tokens; do some fixups here to keep it happy.
4 #ifndef SQUARE_ROOT_TRANSFORMATION
5 #define SQUARE_ROOT_TRANSFORMATION 0
13 vec4 tex2D(sampler2D s, vec2 coord)
15 return texture(s, coord);
18 void cs_output(uvec2 coord, vec4 val)
20 cs_output(ivec2(coord), val);
23 void cs_output(ivec2 coord, vec4 val)
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));
29 imageStore(outbuf, coord, val);