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