• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1uniform float testInput;
2uniform float2x2 testMatrix2x2;
3uniform half4 colorGreen, colorRed;
4
5half4 main(float2 coords) {
6    const float4 constVal = float4(-1, 0, 1, 2);
7    const uint4 expectedA = uint4(0xBF800000, 0x00000000, 0x3F800000, 0x40000000);
8
9    float4 inputVal = float4(testMatrix2x2) * float4(1, 1, -1, -1);
10    const uint4 expectedB = uint4(0x3F800000, 0x40000000, 0xC0400000, 0xC0800000);
11
12    return (floatBitsToUint(constVal.x)    == expectedA.x    &&
13            floatBitsToUint(constVal.xy)   == expectedA.xy   &&
14            floatBitsToUint(constVal.xyz)  == expectedA.xyz  &&
15            floatBitsToUint(constVal.xyzw) == expectedA.xyzw &&
16            floatBitsToUint(inputVal.x)    == expectedB.x    &&
17            floatBitsToUint(inputVal.xy)   == expectedB.xy   &&
18            floatBitsToUint(inputVal.xyz)  == expectedB.xyz  &&
19            floatBitsToUint(inputVal.xyzw) == expectedB.xyzw) ? colorGreen : colorRed;
20}
21