unplugged-system/external/skia/resources/sksl/compute/Desaturate.compute

14 lines
411 B
Plaintext
Raw Normal View History

layout(binding=0) readonly texture2D src;
layout(binding=1) writeonly texture2D dest;
half4 desaturate(half4 color) {
color.rgb = half3(dot(color.rgb, half3(0.22, 0.67, 0.11)));
return color;
}
void main() {
if (sk_GlobalInvocationID.x < width(src) && sk_GlobalInvocationID.y < height(src)) {
write(dest, sk_GlobalInvocationID.xy, desaturate(read(src, sk_GlobalInvocationID.xy)));
}
}