94b1f0dfa1
This was causing errors in UBSAN when compiling some of our existing SkSL tests. Change-Id: I66f22607094df77d47ff70948a139c77feae8624 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464118 Auto-Submit: John Stiles <johnstiles@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
45 lines
2.3 KiB
Plaintext
45 lines
2.3 KiB
Plaintext
uniform half4 colorGreen;
|
|
|
|
half4 main(float2 coords) {
|
|
half huge = 899999999.9 * 999999999.9 * 999999999.9 * 999999999.9 *
|
|
999999999.9 * 999999999.9 * 999999999.9 * 999999999.9 *
|
|
999999999.9 * 999999999.9 * 999999999.9 * 999999999.9 *
|
|
999999999.9 * 999999999.9;
|
|
|
|
int hugeI = 16384
|
|
* 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2
|
|
* 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2;
|
|
|
|
uint hugeU = uint(16384)
|
|
* 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2
|
|
* 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2;
|
|
|
|
short hugeS = short(8192)
|
|
* 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2;
|
|
|
|
ushort hugeUS = ushort(8192)
|
|
* 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2;
|
|
|
|
int hugeNI = -16384
|
|
* 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2
|
|
* 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2;
|
|
|
|
short hugeNS = short(-8192)
|
|
* 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2;
|
|
|
|
const int4 i4 = int4(2, 2, 2, 2);
|
|
int4 hugeIvec = i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 *
|
|
i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 *
|
|
i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4 * i4;
|
|
|
|
const uint4 u4 = uint4(2, 2, 2, 2);
|
|
uint4 hugeUvec = u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 *
|
|
u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 *
|
|
u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4 * u4;
|
|
|
|
return colorGreen * saturate(huge) * saturate(half(hugeI)) * saturate(half(hugeU)) *
|
|
saturate(half(hugeS)) * saturate(half(hugeUS)) *
|
|
saturate(half(hugeNI)) * saturate(half(hugeNS)) *
|
|
saturate(half4(hugeIvec)) * saturate(half4(hugeUvec));
|
|
}
|