72d4c6b574
We use multiplication by 1 or -1 to branchlessly choose one of `min` and `max` in the same function. Change-Id: I44cf747feeae75a9c3e00f36e112e0a429871e86 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527596 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
11 lines
243 B
GLSL
11 lines
243 B
GLSL
#version 400
|
|
out vec4 sk_FragColor;
|
|
uniform vec4 src;
|
|
uniform vec4 dst;
|
|
void main() {
|
|
vec4 _0_a = src + (1.0 - src.w) * dst;
|
|
vec3 _1_b = (1.0 - dst.w) * src.xyz + dst.xyz;
|
|
_0_a.xyz = min(_0_a.xyz, _1_b);
|
|
sk_FragColor = _0_a;
|
|
}
|