.
                // Work around this by using abs instead.
                scale = 1.0 / (1 << abs(exponent));
            }
            else
            {
                scale = 1 << exponent;
            }
            float decimal = 1.0 + float(mantissa) / float(1 << 10);
            f32 = scale * decimal;
        }

        if (sign != 0u)
        {
            f32 = -f32;
        }

        return f32;
    }
#endif

vec2 unpackHalf2x16_emu(uint u)
{
    #if defined(GL_ARB_shading_language_packing)
        return unpackHalf2x16(u);
    #else
        uint y = (u >> 16);
        uint x = u & 0xFFFFu;
        return vec2(f16tof32(x), f16tof32(y));
    #endif
}
