skia2/tests/sksl/shared/golden/DeadStripFunctions.glsl
John Stiles ade695ea4a Add unit test for function dead-stripping.
This test verifies that dead-stripping works on both built-in and user
functions, if their function call is optimized away.

Change-Id: I3125a34640c69de43c383343cd00d97e5a32ac60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338836
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-11-30 15:16:44 +00:00

17 lines
282 B
GLSL

out vec4 sk_FragColor;
vec4 blend_dst(vec4 src, vec4 dst) {
return dst;
}
vec4 live_fn(vec4 a, vec4 b) {
return a + b;
}
void main() {
{
sk_FragColor = live_fn(vec4(3.0), vec4(-3.0));
}
{
sk_FragColor = blend_dst(vec4(7.0), vec4(-7.0));
}
}