1uniform half4 testInputs; 2uniform half4 colorGreen, colorRed; 3 4half4 main(float2 coords) { 5 uint4 uintValues = uint4(testInputs * 100 + 200); 6 7 uint4 expectedA = uint4( 100, 200, 275, 300); 8 9 const uint4 clampLow = uint4( 100, 0, 0, 300); 10 const uint4 constVal = uint4( 75, 200, 275, 425); 11 uint4 expectedB = uint4( 100, 200, 250, 425); 12 const uint4 clampHigh = uint4( 300, 400, 250, 500); 13 14 return (clamp(uintValues.x, 100, 300) == expectedA.x && 15 clamp(uintValues.xy, 100, 300) == expectedA.xy && 16 clamp(uintValues.xyz, 100, 300) == expectedA.xyz && 17 clamp(uintValues.xyzw, 100, 300) == expectedA.xyzw && 18 clamp(constVal.x, 100, 300) == expectedA.x && 19 clamp(constVal.xy, 100, 300) == expectedA.xy && 20 clamp(constVal.xyz, 100, 300) == expectedA.xyz && 21 clamp(constVal.xyzw, 100, 300) == expectedA.xyzw && 22 clamp(uintValues.x, clampLow.x, clampHigh.x ) == expectedB.x && 23 clamp(uintValues.xy, clampLow.xy, clampHigh.xy ) == expectedB.xy && 24 clamp(uintValues.xyz, clampLow.xyz, clampHigh.xyz ) == expectedB.xyz && 25 clamp(uintValues.xyzw, clampLow.xyzw, clampHigh.xyzw) == expectedB.xyzw && 26 clamp(constVal.x, clampLow.x, clampHigh.x ) == expectedB.x && 27 clamp(constVal.xy, clampLow.xy, clampHigh.xy ) == expectedB.xy && 28 clamp(constVal.xyz, clampLow.xyz, clampHigh.xyz ) == expectedB.xyz && 29 clamp(constVal.xyzw, clampLow.xyzw, clampHigh.xyzw) == expectedB.xyzw) ? colorGreen 30 : colorRed; 31} 32