Bitwise operations on float to send to shader (BitConverter.GetBytes on Burst)

Currently I am doing this abomination:
BitConverter.ToSingle(BitConverter.GetBytes((uint)((ToShort(data._00) << 16) | ((adj.up != default ? 1 : 0)) & 0x0000FFFF)), 0);

But burst don’t like it, probably because BitConverter.GetBytes return an array. How can I convert that to a ‘burstable’ piece of code?

math.asuint
math.asfloat

5 Likes