xref: /aosp_15_r20/external/skia/tests/sksl/workarounds/RewriteMatrixComparisons.glsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1*c8dee2aaSAndroid Build Coastguard Worker
2*c8dee2aaSAndroid Build Coastguard Workerprecision mediump float;
3*c8dee2aaSAndroid Build Coastguard Workerprecision mediump sampler2D;
4*c8dee2aaSAndroid Build Coastguard Workerout mediump vec4 sk_FragColor;
5*c8dee2aaSAndroid Build Coastguard Workeruniform mediump vec4 colorGreen;
6*c8dee2aaSAndroid Build Coastguard Workeruniform mediump vec4 colorRed;
7*c8dee2aaSAndroid Build Coastguard Workeruniform mediump mat2 testHalf2x2;
8*c8dee2aaSAndroid Build Coastguard Workeruniform highp mat2 testFloat2x2;
9*c8dee2aaSAndroid Build Coastguard Workeruniform mediump mat3 testHalf3x3;
10*c8dee2aaSAndroid Build Coastguard Workeruniform highp mat4x2 testFloat4x2;
11*c8dee2aaSAndroid Build Coastguard Workermediump vec4 main() {
12*c8dee2aaSAndroid Build Coastguard Worker    mediump mat2 _tempMatrix0;
13*c8dee2aaSAndroid Build Coastguard Worker    mediump mat2 _tempMatrix1;
14*c8dee2aaSAndroid Build Coastguard Worker    highp mat2 _tempMatrix2;
15*c8dee2aaSAndroid Build Coastguard Worker    highp mat2 _tempMatrix3;
16*c8dee2aaSAndroid Build Coastguard Worker    mediump mat2 _tempMatrix4;
17*c8dee2aaSAndroid Build Coastguard Worker    mediump mat2 _tempMatrix5;
18*c8dee2aaSAndroid Build Coastguard Worker    highp mat2 _tempMatrix6;
19*c8dee2aaSAndroid Build Coastguard Worker    highp mat2 _tempMatrix7;
20*c8dee2aaSAndroid Build Coastguard Worker    mediump mat3 _tempMatrix8;
21*c8dee2aaSAndroid Build Coastguard Worker    mediump mat3 _tempMatrix9;
22*c8dee2aaSAndroid Build Coastguard Worker    highp mat4x2 _tempMatrix10;
23*c8dee2aaSAndroid Build Coastguard Worker    highp mat4x2 _tempMatrix11;
24*c8dee2aaSAndroid Build Coastguard Worker    bool _0_ok = true;
25*c8dee2aaSAndroid Build Coastguard Worker    _0_ok = _0_ok && ((_tempMatrix0 = testHalf2x2), (_tempMatrix1 = mat2(1.0, 2.0, 3.0, 4.0)), (_tempMatrix0 == _tempMatrix1));
26*c8dee2aaSAndroid Build Coastguard Worker    _0_ok = _0_ok && ((_tempMatrix2 = testFloat2x2), (_tempMatrix3 = mat2(5.0, 6.0, 7.0, 8.0)), (_tempMatrix2 == _tempMatrix3));
27*c8dee2aaSAndroid Build Coastguard Worker    _0_ok = _0_ok && ((_tempMatrix4 = testHalf2x2), (_tempMatrix5 = mat2(123.0)), (_tempMatrix4 != _tempMatrix5));
28*c8dee2aaSAndroid Build Coastguard Worker    _0_ok = _0_ok && ((_tempMatrix6 = testFloat2x2), (_tempMatrix7 = mat2(456.0)), (_tempMatrix6 != _tempMatrix7));
29*c8dee2aaSAndroid Build Coastguard Worker    _0_ok = _0_ok && ((_tempMatrix8 = testHalf3x3), (_tempMatrix9 = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0)), (_tempMatrix8 == _tempMatrix9));
30*c8dee2aaSAndroid Build Coastguard Worker    _0_ok = _0_ok && ((_tempMatrix10 = testFloat4x2), (_tempMatrix11 = mat4x2(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0)), (_tempMatrix10 != _tempMatrix11));
31*c8dee2aaSAndroid Build Coastguard Worker    return _0_ok ? colorGreen : colorRed;
32*c8dee2aaSAndroid Build Coastguard Worker}
33