• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1layout(local_size_x = 16, local_size_y = 16) in;
2
3layout(rgba8, binding=0) readonly texture2D src;
4layout(rgba8, binding=1) writeonly texture2D dest;
5
6half4 desaturate(half4 color) {
7    color.rgb = half3(dot(color.rgb, half3(0.22, 0.67, 0.11)));
8    return color;
9}
10
11void main() {
12    if (sk_GlobalInvocationID.x < textureWidth(src) && sk_GlobalInvocationID.y < textureHeight(src)) {
13        textureWrite(dest, sk_GlobalInvocationID.xy, desaturate(textureRead(src, sk_GlobalInvocationID.xy)));
14    }
15}
16