pack2x16unorm
On this page

pack2x16unorm()

Function in Builtins

Pack a vec2<f32> into a u32 as two 16-bit unorm values, ⌊0.5 + 65535·clamp(x, 0, 1)⌋ per component, component 0 in the 16 low bits.

import { pack2x16unorm } from 'typeshade'

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

Syntax

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

Parameters

v ReadonlyNode<'vec2<f32>'>

Return value

Node<'u32'>

Description

The 16-bit step up from the 8-bit channels of pack4x8unorm. Spelled packUnorm2x16 on GLSL ES 3.00.

Targets

TargetSupportNotes
WGSL (WebGPU) Supported

pack2x16unorm(v).

GLSL ES 3.00 (WebGL2) Supported

packUnorm2x16(v).

CPU oracle Supported

Evaluated in f64 by the oracle.

See also

Source

src/core/ir/node.ts, line 1905, at commit 26de7be8

Edit this page Report a problem