2b788b11e0
Several blend functions generate a surprisingly large amount of code, and appear to have opportunities for further optimization. At any rate, if we make compiler changes that would affect the output of a blend function, I think we would want to see the changes reflected in our golden outputs. Change-Id: Iff612dcd4bad8824b5e6e97413ffce19e5ea1c0e Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318336 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
15 lines
423 B
GLSL
15 lines
423 B
GLSL
#version 400
|
|
uniform vec4 src, dst;
|
|
vec4 blend_difference(vec4 src, vec4 dst) {
|
|
return vec4((src.xyz + dst.xyz) - 2.0 * min(src.xyz * dst.w, dst.xyz * src.w), src.w + (1.0 - src.w) * dst.w);
|
|
}
|
|
vec4 main() {
|
|
vec4 _0_blend_difference;
|
|
{
|
|
_0_blend_difference = vec4((src.xyz + dst.xyz) - 2.0 * min(src.xyz * dst.w, dst.xyz * src.w), src.w + (1.0 - src.w) * dst.w);
|
|
}
|
|
|
|
return _0_blend_difference;
|
|
|
|
}
|