skia2/tests/sksl/shared/MatrixToVectorCast.glsl

13 lines
367 B
Plaintext
Raw Normal View History

Reland "Add tests for matrix-vector conversions." This reverts commit f009db5b854b350e9f884fd5268e80271537578b. Reason for revert: test disabled on Win10 + Intel 4400/6100 Original change's description: > Revert "Add tests for matrix-vector conversions." > > This reverts commit a89781215a8182beb0893a004654fef157313259. > > Reason for revert: breakage on Windows > > Original change's description: > > Add tests for matrix-vector conversions. > > > > GLSL supports casting vec4 into mat2 and vice versa, so SkSL should have > > equivalent support. Adding tests as a starting point. > > > > Change-Id: If8bcbf99afcec94d948d5da9e6205cb4a232af18 > > Bug: skia:12067 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425837 > > Auto-Submit: John Stiles <johnstiles@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: I2563041f538b1b20074385f1b61af5fc506ffad5 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:12067 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426057 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> Bug: skia:12067 Change-Id: I1379914ee39ce340f09b11b3754820db9c645378 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426058 Reviewed-by: John Stiles <johnstiles@google.com> Auto-Submit: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-07-08 22:20:21 +00:00
out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
uniform mat2 testMatrix2x2;
vec4 main() {
bool ok = true;
ok = ok && vec4(testMatrix2x2) == vec4(1.0, 2.0, 3.0, 4.0);
ok = ok && vec4(testMatrix2x2) == vec4(1.0, 2.0, 3.0, 4.0);
ok = ok && ivec4(vec4(testMatrix2x2)) == ivec4(1, 2, 3, 4);
return ok ? colorGreen : colorRed;
}