spirv_std::float

Function f32_to_f16

Source
pub fn f32_to_f16(float: f32) -> u32
Expand description

Converts an f32 (float) into an f16 (half). The result is a u32, not a u16, due to GPU support for u16 not being universal - the upper 16 bits will always be zero.