skia2/resources/sksl/intrinsics/IntBitsToFloat.sksl
John Stiles 469fb3c619 Rename variables named input in test files.
`input` is a reserved word in GLSL. http://screen/85m4iRwvJRadKbV

Change-Id: Iffc0a47d916a2419a27767902c839e09bfa7fe26
Bug: skia:11115
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/454736
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-09-30 16:39:21 +00:00

21 lines
929 B
Plaintext

uniform float testInput;
uniform float2x2 testMatrix2x2;
uniform half4 colorGreen, colorRed;
half4 main(float2 coords) {
const float4 constVal = float4(-1, 0, 1, 2);
const int4 expectedA = int4(-0x40800000, 0x00000000, 0x3F800000, 0x40000000);
float4 inputVal = float4(testMatrix2x2) * float4(1, 1, -1, -1);
int4 expectedB = int4(0x3F800000, 0x40000000, -0x3FC00000, -0x3F800000);
return (constVal.x == intBitsToFloat(expectedA.x) &&
constVal.xy == intBitsToFloat(expectedA.xy) &&
constVal.xyz == intBitsToFloat(expectedA.xyz) &&
constVal.xyzw == intBitsToFloat(expectedA.xyzw) &&
inputVal.x == intBitsToFloat(expectedB.x) &&
inputVal.xy == intBitsToFloat(expectedB.xy) &&
inputVal.xyz == intBitsToFloat(expectedB.xyz) &&
inputVal.xyzw == intBitsToFloat(expectedB.xyzw)) ? colorGreen : colorRed;
}