Module spirv_std::float

source ·
Expand description

Traits and helper functions related to floats.

Traits

Abstract trait representing a SPIR-V floating point type.

Functions

Converts two f16 values (halfs) into two f32 values (floats). The parameter is a u32, with the low 16 bits being the first f16, and the high 16 bits being the second f16.
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.
Unpacks 4 8-bit signed integers into a vec4. See UnpackSnorm4x8 for exact semantics.
Unpacks 4 8-bit unsigned integers into a vec4. See UnpackSnorm4x8 for exact semantics.
Unpacks 2 16-bit signed integers into a vec2. See UnpackSnorm2x16 for exact semantics.
Unpacks 2 16-bit unsigned integers into a vec2. See UnpackUnorm2x16 for exact semantics.
Converts two f32 values (floats) into two f16 values (halfs). The result is a u32, with the low 16 bits being the first f16, and the high 16 bits being the second f16.
Packs a vec2 into 2 16-bit signed integers. See PackSnorm2x16 for exact semantics.
Packs a vec2 into 2 16-bit unsigned integers. See PackUnorm2x16 for exact semantics.
Packs a vec4 into 4 8-bit signed integers. See PackSnorm4x8 for exact semantics.
Packs a vec4 into 4 8-bit unsigned integers. See PackUnorm4x8 for exact semantics.