unpack2x16float
On this page

unpack2x16float()

Function in Builtins

Unpack a u32 into a vec2<f32> of two binary16 (half) values, the exact inverse of pack2x16float.

import { unpack2x16float } from 'typeshade/core/ir'

This export returns an IR node. A "use typeshade" file calls the builtin itself: unpack2x16float()

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

Syntax

const unpack2x16float: (v: ReadonlyNode<"u32">) => Node<"vec2<f32>">

Parameters

v ReadonlyNode<'u32'>

Return value

Node<'vec2<f32>'>

Description

Component 0 comes from the 16 low bits. Spelled unpackHalf2x16 on GLSL ES 3.00.

Targets

TargetSupportNotes
WGSL (WebGPU) Supported

unpack2x16float(v).

GLSL ES 3.00 (WebGL2) Supported

unpackHalf2x16(v).

CPU oracle Supported

Evaluated in f64 by the oracle.

See also

Source

src/core/ir/node.ts, line 1656, at commit af54ddad5

Edit this page Report a problem