return (x < 1.0) ? poly : HALF_PI - poly;
}
#if (SHADER_TARGET >= 50)
#if (SHADER_TARGET >= 45)
uint FastLog2(uint x)
{
return firstbithigh(x) - 1u;
// Ref: http://holger.dammertz.org/stuff/notes_HammersleyOnHemisphere.html
uint ReverseBits32(uint bits)
return reversebits(bits);
#else
bits = (bits << 16) | (bits >> 16);