skia2/resources/sksl/shared/Matrices.sksl

110 lines
3.3 KiB
Plaintext
Raw Normal View History

uniform half4 colorGreen, colorRed;
uniform float2x2 testMatrix2x2;
bool test_float() {
Reland "The Matrices test now verifies its results." This reverts commit 90508f02dc599ccec1319bfd54617d3548293668. Reason for revert: avoiding driver bugs this time Original change's description: > Revert "The Matrices test now verifies its results." > > This reverts commit 86121f6c0e502e9ef35355162ba64c045f59c0b4. > > Reason for revert: tree sad > > Original change's description: > > The Matrices test now verifies its results. > > > > Previously, this test did a bunch of matrix math but never actually > > checked its results for correctness. > > > > Change-Id: I353be58049286266c2d561b0939b3874d2684403 > > Bug: skia:11985 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407360 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: I1335f01c14ee955426e02efaa3c30421cd41aa34 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11985 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407617 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> Bug: skia:11985 Change-Id: I214375d74977f324973da72c440d7ff5ff179016 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408157 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-05-13 15:30:22 +00:00
bool ok = true;
float2x2 m1 = testMatrix2x2;
Reland "The Matrices test now verifies its results." This reverts commit 90508f02dc599ccec1319bfd54617d3548293668. Reason for revert: avoiding driver bugs this time Original change's description: > Revert "The Matrices test now verifies its results." > > This reverts commit 86121f6c0e502e9ef35355162ba64c045f59c0b4. > > Reason for revert: tree sad > > Original change's description: > > The Matrices test now verifies its results. > > > > Previously, this test did a bunch of matrix math but never actually > > checked its results for correctness. > > > > Change-Id: I353be58049286266c2d561b0939b3874d2684403 > > Bug: skia:11985 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407360 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: I1335f01c14ee955426e02efaa3c30421cd41aa34 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11985 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407617 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> Bug: skia:11985 Change-Id: I214375d74977f324973da72c440d7ff5ff179016 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408157 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-05-13 15:30:22 +00:00
ok = ok && (m1 == float2x2(1, 2, 3, 4));
// This generates {5, 0, 0, 5} on some Radeon GPUs.
// float2x2 m2 = float2x2(float4(5));
// ok = ok && (m2 == float2x2(5, 5, 5, 5));
float2x2 m3 = float2x2(m1);
Reland "The Matrices test now verifies its results." This reverts commit 90508f02dc599ccec1319bfd54617d3548293668. Reason for revert: avoiding driver bugs this time Original change's description: > Revert "The Matrices test now verifies its results." > > This reverts commit 86121f6c0e502e9ef35355162ba64c045f59c0b4. > > Reason for revert: tree sad > > Original change's description: > > The Matrices test now verifies its results. > > > > Previously, this test did a bunch of matrix math but never actually > > checked its results for correctness. > > > > Change-Id: I353be58049286266c2d561b0939b3874d2684403 > > Bug: skia:11985 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407360 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: I1335f01c14ee955426e02efaa3c30421cd41aa34 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11985 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407617 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> Bug: skia:11985 Change-Id: I214375d74977f324973da72c440d7ff5ff179016 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408157 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-05-13 15:30:22 +00:00
ok = ok && (m3 == float2x2(1, 2, 3, 4));
float2x2 m4 = float2x2(6);
ok = ok && (m4 == float2x2(6, 0, 0, 6));
m3 *= m4;
Reland "The Matrices test now verifies its results." This reverts commit 90508f02dc599ccec1319bfd54617d3548293668. Reason for revert: avoiding driver bugs this time Original change's description: > Revert "The Matrices test now verifies its results." > > This reverts commit 86121f6c0e502e9ef35355162ba64c045f59c0b4. > > Reason for revert: tree sad > > Original change's description: > > The Matrices test now verifies its results. > > > > Previously, this test did a bunch of matrix math but never actually > > checked its results for correctness. > > > > Change-Id: I353be58049286266c2d561b0939b3874d2684403 > > Bug: skia:11985 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407360 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: I1335f01c14ee955426e02efaa3c30421cd41aa34 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11985 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407617 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> Bug: skia:11985 Change-Id: I214375d74977f324973da72c440d7ff5ff179016 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408157 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-05-13 15:30:22 +00:00
ok = ok && (m3 == float2x2(6, 12, 18, 24));
float2x2 m5 = float2x2(m1[1][1]);
ok = ok && (m5 == float2x2(4, 0, 0, 4));
m1 += m5;
ok = ok && (m1 == float2x2(5, 2, 3, 8));
float2x2 m7 = float2x2(5, 6, float2(7, 8));
Reland "The Matrices test now verifies its results." This reverts commit 90508f02dc599ccec1319bfd54617d3548293668. Reason for revert: avoiding driver bugs this time Original change's description: > Revert "The Matrices test now verifies its results." > > This reverts commit 86121f6c0e502e9ef35355162ba64c045f59c0b4. > > Reason for revert: tree sad > > Original change's description: > > The Matrices test now verifies its results. > > > > Previously, this test did a bunch of matrix math but never actually > > checked its results for correctness. > > > > Change-Id: I353be58049286266c2d561b0939b3874d2684403 > > Bug: skia:11985 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407360 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: I1335f01c14ee955426e02efaa3c30421cd41aa34 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11985 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407617 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> Bug: skia:11985 Change-Id: I214375d74977f324973da72c440d7ff5ff179016 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408157 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-05-13 15:30:22 +00:00
ok = ok && (m7 == float2x2(5, 6, 7, 8));
float3x3 m9 = float3x3(9);
ok = ok && (m9 == float3x3(9, 0, 0, 0, 9, 0, 0, 0, 9));
float4x4 m10 = float4x4(11);
ok = ok && (m10 == float4x4(11, 0, 0, 0, 0, 11, 0, 0, 0, 0, 11, 0, 0, 0, 0, 11));
float4x4 m11 = float4x4(20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20);
m11 -= m10;
Reland "The Matrices test now verifies its results." This reverts commit 90508f02dc599ccec1319bfd54617d3548293668. Reason for revert: avoiding driver bugs this time Original change's description: > Revert "The Matrices test now verifies its results." > > This reverts commit 86121f6c0e502e9ef35355162ba64c045f59c0b4. > > Reason for revert: tree sad > > Original change's description: > > The Matrices test now verifies its results. > > > > Previously, this test did a bunch of matrix math but never actually > > checked its results for correctness. > > > > Change-Id: I353be58049286266c2d561b0939b3874d2684403 > > Bug: skia:11985 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407360 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: I1335f01c14ee955426e02efaa3c30421cd41aa34 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11985 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407617 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> Bug: skia:11985 Change-Id: I214375d74977f324973da72c440d7ff5ff179016 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408157 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-05-13 15:30:22 +00:00
ok = ok && (m11 == float4x4(9, 20, 20, 20, 20, 9, 20, 20, 20, 20, 9, 20, 20, 20, 20, 9));
float4 f4 = float4(testMatrix2x2);
ok = ok && float2x2(f4.xy, f4.z, 4) ==
float2x2(1, 2, 3, 4);
ok = ok && float3x3(f4.xy, f4.z, f4.w, f4.xy, f4.zw, f4.x) ==
float3x3(1, 2, 3, 4, 1, 2, 3, 4, 1);
ok = ok && float4x4(f4.xy, f4.zw, f4.xyz, f4.w, f4.xyzw, 1, f4.yzw) ==
float4x4(1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4);
Reland "The Matrices test now verifies its results." This reverts commit 90508f02dc599ccec1319bfd54617d3548293668. Reason for revert: avoiding driver bugs this time Original change's description: > Revert "The Matrices test now verifies its results." > > This reverts commit 86121f6c0e502e9ef35355162ba64c045f59c0b4. > > Reason for revert: tree sad > > Original change's description: > > The Matrices test now verifies its results. > > > > Previously, this test did a bunch of matrix math but never actually > > checked its results for correctness. > > > > Change-Id: I353be58049286266c2d561b0939b3874d2684403 > > Bug: skia:11985 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407360 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: I1335f01c14ee955426e02efaa3c30421cd41aa34 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11985 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407617 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> Bug: skia:11985 Change-Id: I214375d74977f324973da72c440d7ff5ff179016 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408157 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-05-13 15:30:22 +00:00
return ok;
}
bool test_half() {
Reland "The Matrices test now verifies its results." This reverts commit 90508f02dc599ccec1319bfd54617d3548293668. Reason for revert: avoiding driver bugs this time Original change's description: > Revert "The Matrices test now verifies its results." > > This reverts commit 86121f6c0e502e9ef35355162ba64c045f59c0b4. > > Reason for revert: tree sad > > Original change's description: > > The Matrices test now verifies its results. > > > > Previously, this test did a bunch of matrix math but never actually > > checked its results for correctness. > > > > Change-Id: I353be58049286266c2d561b0939b3874d2684403 > > Bug: skia:11985 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407360 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: I1335f01c14ee955426e02efaa3c30421cd41aa34 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11985 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407617 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> Bug: skia:11985 Change-Id: I214375d74977f324973da72c440d7ff5ff179016 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408157 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-05-13 15:30:22 +00:00
bool ok = true;
half2x2 m1 = half2x2(testMatrix2x2);
Reland "The Matrices test now verifies its results." This reverts commit 90508f02dc599ccec1319bfd54617d3548293668. Reason for revert: avoiding driver bugs this time Original change's description: > Revert "The Matrices test now verifies its results." > > This reverts commit 86121f6c0e502e9ef35355162ba64c045f59c0b4. > > Reason for revert: tree sad > > Original change's description: > > The Matrices test now verifies its results. > > > > Previously, this test did a bunch of matrix math but never actually > > checked its results for correctness. > > > > Change-Id: I353be58049286266c2d561b0939b3874d2684403 > > Bug: skia:11985 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407360 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: I1335f01c14ee955426e02efaa3c30421cd41aa34 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11985 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407617 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> Bug: skia:11985 Change-Id: I214375d74977f324973da72c440d7ff5ff179016 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408157 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-05-13 15:30:22 +00:00
ok = ok && (m1 == half2x2(1, 2, 3, 4));
// This generates {5, 0, 0, 5} on some Radeon GPUs.
// half2x2 m2 = half2x2(half4(5));
// ok = ok && (m2 == half2x2(5, 5, 5, 5));
half2x2 m3 = half2x2(m1);
Reland "The Matrices test now verifies its results." This reverts commit 90508f02dc599ccec1319bfd54617d3548293668. Reason for revert: avoiding driver bugs this time Original change's description: > Revert "The Matrices test now verifies its results." > > This reverts commit 86121f6c0e502e9ef35355162ba64c045f59c0b4. > > Reason for revert: tree sad > > Original change's description: > > The Matrices test now verifies its results. > > > > Previously, this test did a bunch of matrix math but never actually > > checked its results for correctness. > > > > Change-Id: I353be58049286266c2d561b0939b3874d2684403 > > Bug: skia:11985 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407360 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: I1335f01c14ee955426e02efaa3c30421cd41aa34 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11985 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407617 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> Bug: skia:11985 Change-Id: I214375d74977f324973da72c440d7ff5ff179016 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408157 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-05-13 15:30:22 +00:00
ok = ok && (m3 == half2x2(1, 2, 3, 4));
half2x2 m4 = half2x2(6);
ok = ok && (m4 == half2x2(6, 0, 0, 6));
m3 *= m4;
Reland "The Matrices test now verifies its results." This reverts commit 90508f02dc599ccec1319bfd54617d3548293668. Reason for revert: avoiding driver bugs this time Original change's description: > Revert "The Matrices test now verifies its results." > > This reverts commit 86121f6c0e502e9ef35355162ba64c045f59c0b4. > > Reason for revert: tree sad > > Original change's description: > > The Matrices test now verifies its results. > > > > Previously, this test did a bunch of matrix math but never actually > > checked its results for correctness. > > > > Change-Id: I353be58049286266c2d561b0939b3874d2684403 > > Bug: skia:11985 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407360 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: I1335f01c14ee955426e02efaa3c30421cd41aa34 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11985 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407617 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> Bug: skia:11985 Change-Id: I214375d74977f324973da72c440d7ff5ff179016 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408157 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-05-13 15:30:22 +00:00
ok = ok && (m3 == half2x2(6, 12, 18, 24));
half2x2 m5 = half2x2(m1[1][1]);
ok = ok && (m5 == half2x2(4, 0, 0, 4));
m1 += m5;
ok = ok && (m1 == half2x2(5, 2, 3, 8));
half2x2 m7 = half2x2(5, 6, half2(7, 8));
Reland "The Matrices test now verifies its results." This reverts commit 90508f02dc599ccec1319bfd54617d3548293668. Reason for revert: avoiding driver bugs this time Original change's description: > Revert "The Matrices test now verifies its results." > > This reverts commit 86121f6c0e502e9ef35355162ba64c045f59c0b4. > > Reason for revert: tree sad > > Original change's description: > > The Matrices test now verifies its results. > > > > Previously, this test did a bunch of matrix math but never actually > > checked its results for correctness. > > > > Change-Id: I353be58049286266c2d561b0939b3874d2684403 > > Bug: skia:11985 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407360 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: I1335f01c14ee955426e02efaa3c30421cd41aa34 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11985 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407617 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> Bug: skia:11985 Change-Id: I214375d74977f324973da72c440d7ff5ff179016 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408157 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-05-13 15:30:22 +00:00
ok = ok && (m7 == half2x2(5, 6, 7, 8));
half3x3 m9 = half3x3(9);
ok = ok && (m9 == half3x3(9, 0, 0, 0, 9, 0, 0, 0, 9));
half4x4 m10 = half4x4(11);
ok = ok && (m10 == half4x4(11, 0, 0, 0, 0, 11, 0, 0, 0, 0, 11, 0, 0, 0, 0, 11));
half4x4 m11 = half4x4(20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20);
m11 -= m10;
Reland "The Matrices test now verifies its results." This reverts commit 90508f02dc599ccec1319bfd54617d3548293668. Reason for revert: avoiding driver bugs this time Original change's description: > Revert "The Matrices test now verifies its results." > > This reverts commit 86121f6c0e502e9ef35355162ba64c045f59c0b4. > > Reason for revert: tree sad > > Original change's description: > > The Matrices test now verifies its results. > > > > Previously, this test did a bunch of matrix math but never actually > > checked its results for correctness. > > > > Change-Id: I353be58049286266c2d561b0939b3874d2684403 > > Bug: skia:11985 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407360 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: I1335f01c14ee955426e02efaa3c30421cd41aa34 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11985 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407617 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> Bug: skia:11985 Change-Id: I214375d74977f324973da72c440d7ff5ff179016 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408157 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-05-13 15:30:22 +00:00
ok = ok && (m11 == half4x4(9, 20, 20, 20, 20, 9, 20, 20, 20, 20, 9, 20, 20, 20, 20, 9));
half4 h4 = half4(testMatrix2x2);
ok = ok && half2x2(h4.xy, h4.z, 4) ==
half2x2(1, 2, 3, 4);
ok = ok && half3x3(h4.xy, h4.z, h4.w, h4.xy, h4.zw, h4.x) ==
half3x3(1, 2, 3, 4, 1, 2, 3, 4, 1);
ok = ok && half4x4(h4.xy, h4.zw, h4.xyz, h4.w, h4.xyzw, 1, h4.yzw) ==
half4x4(1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4);
Reland "The Matrices test now verifies its results." This reverts commit 90508f02dc599ccec1319bfd54617d3548293668. Reason for revert: avoiding driver bugs this time Original change's description: > Revert "The Matrices test now verifies its results." > > This reverts commit 86121f6c0e502e9ef35355162ba64c045f59c0b4. > > Reason for revert: tree sad > > Original change's description: > > The Matrices test now verifies its results. > > > > Previously, this test did a bunch of matrix math but never actually > > checked its results for correctness. > > > > Change-Id: I353be58049286266c2d561b0939b3874d2684403 > > Bug: skia:11985 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407360 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: I1335f01c14ee955426e02efaa3c30421cd41aa34 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11985 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407617 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> Bug: skia:11985 Change-Id: I214375d74977f324973da72c440d7ff5ff179016 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408157 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-05-13 15:30:22 +00:00
return ok;
}
bool test_comma() {
float2x2 x, y;
return (x = float2x2(1, 2, 3, 4),
y = 0.5 * float2x2(2, 4, 6, 8),
x == y);
}
half4 main(float2 coords) {
return test_float() && test_half() && test_comma() ? colorGreen : colorRed;
}