skia2/tests/sksl/blend/BlendOverlayStandaloneSettings.glsl
John Stiles ece1d794b9 Mangle function names in GLSL.
This will be implemented in Metal and SPIR-V in followup CLs.

Change-Id: I397b4db40b15dd54cf1d8a17f414c3fe184b48d2
Bug: skia:10851
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/387638
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-22 17:18:26 +00:00

13 lines
534 B
GLSL

out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
float _blend_overlay_component_hh2h2(vec2 s, vec2 d) {
return 2.0 * d.x <= d.y ? (2.0 * s.x) * d.x : s.y * d.y - (2.0 * (d.y - d.x)) * (s.y - s.x);
}
void main() {
vec4 _0_result = vec4(_blend_overlay_component_hh2h2(src.xw, dst.xw), _blend_overlay_component_hh2h2(src.yw, dst.yw), _blend_overlay_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
_0_result.xyz += dst.xyz * (1.0 - src.w) + src.xyz * (1.0 - dst.w);
sk_FragColor = _0_result;
}