1cb93a386Sopenharmony_ciuniform half4 colorGreen, colorRed; 2cb93a386Sopenharmony_ciuniform float4 testInputs; // equals (-1.25, 0, 0.75, 2.25) 3cb93a386Sopenharmony_ci 4cb93a386Sopenharmony_cihalf4 main(float2 coords) { 5cb93a386Sopenharmony_ci const float4 constVal = float4(-1.25, 0, 0.75, 2.25); 6cb93a386Sopenharmony_ci const float4 expected = clamp(constVal, 0, 1); 7cb93a386Sopenharmony_ci const uint constXY = packUnorm2x16(constVal.xy); 8cb93a386Sopenharmony_ci const uint constZW = packUnorm2x16(constVal.zw); 9cb93a386Sopenharmony_ci uint xy = packUnorm2x16(testInputs.xy); 10cb93a386Sopenharmony_ci uint zw = packUnorm2x16(testInputs.zw); 11cb93a386Sopenharmony_ci const float2 tolerance = float2(0.015625); 12cb93a386Sopenharmony_ci 13cb93a386Sopenharmony_ci return (all(lessThan(abs(unpackUnorm2x16(xy) - float2(expected.xy)), tolerance)) && 14cb93a386Sopenharmony_ci all(lessThan(abs(unpackUnorm2x16(zw) - float2(expected.zw)), tolerance)) && 15cb93a386Sopenharmony_ci all(lessThan(abs(unpackUnorm2x16(constXY) - float2(expected.xy)), tolerance)) && 16cb93a386Sopenharmony_ci all(lessThan(abs(unpackUnorm2x16(constZW) - float2(expected.zw)), tolerance))) 17cb93a386Sopenharmony_ci ? colorGreen : colorRed; 18cb93a386Sopenharmony_ci} 19