skia2/tests/sksl/shared/golden/VectorFolding.glsl
John Stiles d059005b93 Avoid creating unnecessary scopes during inlining.
The additional scopes were harmless, but didn't really add any value.
Originally they were used to tightly scope inlined variables, but we now
mangle inlined variable names.

Change-Id: I7b35e737598036c0b6d3d9f71cbcd4a53d609ce9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344757
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-12-15 21:11:45 +00:00

113 lines
3.3 KiB
GLSL

out vec4 sk_FragColor;
void main() {
sk_FragColor.x = 0.5;
sk_FragColor = vec4(6.0, 7.0, 9.0, 11.0);
sk_FragColor = vec4(7.0, 9.0, 9.0, 9.0);
sk_FragColor = vec4(2.0, 4.0, 6.0, 8.0);
sk_FragColor = vec4(12.0, 6.0, 4.0, 3.0);
sk_FragColor.x = 6.0;
sk_FragColor.x = 1.0;
sk_FragColor.x = -2.0;
sk_FragColor.x = 3.0;
sk_FragColor.x = 4.0;
sk_FragColor.x = -5.0;
sk_FragColor.x = 6.0;
sk_FragColor.x = 7.0;
sk_FragColor.x = -8.0;
sk_FragColor.x = 9.0;
sk_FragColor.x = -10.0;
sk_FragColor.x = -11.0;
sk_FragColor.x = -12.0;
sk_FragColor.x = 13.0;
sk_FragColor.x = -11.0;
sk_FragColor.x = -12.0;
sk_FragColor.x = 13.0;
sk_FragColor.x = -11.0;
sk_FragColor.x = -12.0;
sk_FragColor.x = -13.0;
sk_FragColor.x = -11.0;
sk_FragColor.x = -12.0;
sk_FragColor.x = -13.0;
sk_FragColor = vec4(sqrt(1.0));
sk_FragColor = vec4(sqrt(2.0));
sk_FragColor = vec4(0.0);
sk_FragColor = vec4(0.0);
sk_FragColor = vec4(0.0);
sk_FragColor = vec4(sqrt(6.0));
sk_FragColor = vec4(sqrt(7.0));
sk_FragColor = vec4(sqrt(8.0));
sk_FragColor = vec4(sqrt(9.0));
sk_FragColor = vec4(0.0);
sk_FragColor = vec4(0.0);
sk_FragColor = vec4(sqrt(12.0));
sk_FragColor = vec4(sqrt(13.0));
sk_FragColor = vec4(0.0);
sk_FragColor = vec4(0.0);
sk_FragColor = vec4(sqrt(16.0));
sk_FragColor = vec4(sqrt(17.0));
sk_FragColor = vec4(0.0);
sk_FragColor = vec4(sqrt(19.0));
sk_FragColor = vec4(sqrt(19.5));
sk_FragColor = vec4(sqrt(20.0));
sk_FragColor = vec4(sqrt(21.0));
sk_FragColor = vec4(sqrt(22.0));
sk_FragColor = vec4(sqrt(23.0));
sk_FragColor = vec4(sqrt(24.0));
sk_FragColor += vec4(1.0);
sk_FragColor -= vec4(1.0);
sk_FragColor *= vec4(2.0);
sk_FragColor /= vec4(2.0);
ivec4 _0_result;
_0_result.x = 2;
_0_result = ivec4(6, 7, 9, 11);
_0_result = ivec4(7, 9, 9, 9);
_0_result = ivec4(2, 4, 6, 8);
_0_result = ivec4(12, 6, 4, 3);
sk_FragColor.x = 6.0;
sk_FragColor.x = 1.0;
sk_FragColor.x = -2.0;
sk_FragColor.x = 3.0;
sk_FragColor.x = 4.0;
sk_FragColor.x = -5.0;
sk_FragColor.x = 6.0;
sk_FragColor.x = 7.0;
sk_FragColor.x = -8.0;
sk_FragColor.x = 9.0;
sk_FragColor.x = -10.0;
_0_result = ivec4(int(sqrt(1.0)));
_0_result = ivec4(int(sqrt(2.0)));
_0_result = ivec4(0);
_0_result = ivec4(0);
_0_result = ivec4(0);
_0_result = ivec4(int(sqrt(6.0)));
_0_result = ivec4(int(sqrt(7.0)));
_0_result = ivec4(int(sqrt(8.0)));
_0_result = ivec4(int(sqrt(9.0)));
_0_result = ivec4(0);
_0_result = ivec4(0);
_0_result = ivec4(int(sqrt(12.0)));
_0_result = ivec4(int(sqrt(13.0)));
_0_result = ivec4(0);
_0_result = ivec4(0);
_0_result = ivec4(int(sqrt(16.0)));
_0_result = ivec4(int(sqrt(17.0)));
_0_result = ivec4(0);
_0_result = ivec4(int(sqrt(19.0)));
_0_result = ivec4(int(sqrt(19.5)));
_0_result = ivec4(int(sqrt(20.0)));
_0_result = ivec4(int(sqrt(21.0)));
_0_result = ivec4(int(sqrt(22.0)));
_0_result = ivec4(int(sqrt(23.0)));
_0_result = ivec4(int(sqrt(24.0)));
_0_result += ivec4(1);
_0_result -= ivec4(1);
_0_result *= ivec4(2);
_0_result /= ivec4(2);
sk_FragColor = vec4(_0_result);
}