Skip to content

Commit 6c88ea1

Browse files
johnstiles-googleSkia Commit-Bot
authored andcommitted
Create unit test for comparison against a negated constant vector.
Change-Id: Ibc1a8d3ebbf62cc55d013f7d9146f6b155d11da2 Bug: oss-fuzz:26830, oss-fuzz:26789 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332377 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>
1 parent 5715499 commit 6c88ea1

File tree

3 files changed

+8
-22
lines changed

3 files changed

+8
-22
lines changed
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
void main() {
2-
if (half4(1) == half4(-half2(-1), half2(1)))
3-
sk_FragColor = half4(1);
4-
else
5-
sk_FragColor = half4(-1);
2+
sk_FragColor.r = (half4(1) == half4(-half2(-1), half2(1))) ? 1 : 0;
3+
sk_FragColor.g = (half4(1) == -half4(1)) ? 1 : 0;
4+
sk_FragColor.b = (half4(0) == -half4(0)) ? 1 : 0;
65
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1+
### Compilation failed:
2+
13

2-
out vec4 sk_FragColor;
3-
void main() {
4-
sk_FragColor = vec4(1.0);
5-
}
Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
#include <metal_stdlib>
2-
#include <simd/simd.h>
3-
using namespace metal;
4-
struct Inputs {
5-
};
6-
struct Outputs {
7-
float4 sk_FragColor [[color(0)]];
8-
};
9-
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
10-
Outputs _outputStruct;
11-
thread Outputs* _out = &_outputStruct;
12-
_out->sk_FragColor = float4(1.0);
13-
return *_out;
14-
}
1+
### Compilation failed:
2+
3+

0 commit comments

Comments
 (0)