skia2/tests/sksl/shared/Matrices.glsl
John Stiles 132cfdd49d Revert "Inline functions of the form 'return (expr)' only."
This reverts commit 92748af1a5.

Reason for revert: SkSLCommaSideEffects_GPU crashing on Android

Original change's description:
> Inline functions of the form 'return (expr)' only.
>
> This drastically reduces the number of functions which we allow to be
> inlined. If this change does not hurt our performance, it will allow us
> to trivially remove hundreds of LOC. All current data leads us to
> believe that it may affect the Mali 400 but is highly unlikely to change
> results on any other device in the tree.
>
> More info: http://go/optimization-in-sksl-inliner
>
> Change-Id: Ia6b706742ce5407453e0e697b6c1f9201084c0e8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384858
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>

TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com

Change-Id: I6a670dacaa58fe3386ff50375ac6d1cac4fd7f2c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/385161
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-03-15 22:08:48 +00:00

41 lines
1.1 KiB
GLSL

out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
bool test_half() {
vec3 v1 = mat3(1.0) * vec3(2.0);
vec3 v2 = vec3(2.0) * mat3(1.0);
mat2 m1 = mat2(1.0, 2.0, 3.0, 4.0);
mat2 m2 = mat2(vec4(0.0));
mat2 m3 = m1;
mat2 m4 = mat2(1.0);
m3 *= m4;
mat2 m5 = mat2(m1[0].x);
mat2 m6 = mat2(1.0, 2.0, 3.0, 4.0);
m6 += m5;
mat2 m7 = mat2(5.0, 6.0, 7.0, 8.0);
mat3 m9 = mat3(1.0);
mat4 m10 = mat4(1.0);
mat4 m11 = mat4(2.0);
m11 -= m10;
return true;
}
vec4 main() {
vec3 _0_v1 = mat3(1.0) * vec3(2.0);
vec3 _1_v2 = vec3(2.0) * mat3(1.0);
mat2 _2_m1 = mat2(1.0, 2.0, 3.0, 4.0);
mat2 _3_m2 = mat2(vec4(0.0));
mat2 _4_m3 = _2_m1;
mat2 _5_m4 = mat2(1.0);
_4_m3 *= _5_m4;
mat2 _6_m5 = mat2(_2_m1[0].x);
mat2 _7_m6 = mat2(1.0, 2.0, 3.0, 4.0);
_7_m6 += _6_m5;
mat2 _8_m7 = mat2(5.0, 6.0, 7.0, 8.0);
mat3 _9_m9 = mat3(1.0);
mat4 _10_m10 = mat4(1.0);
mat4 _11_m11 = mat4(2.0);
_11_m11 -= _10_m10;
return true && test_half() ? colorGreen : colorRed;
}