---
title: "pack2x16unorm(): IR builder function in typeshade/core/ir"
description: "pack2x16unorm, an IR builder function in typeshade/core/ir. Pack a vec2<f32> into a u32 as two 16-bit unorm values, ⌊0.5 + 65535·clamp(x, 0, 1)⌋ per component…"
url: https://typeshade.dev/api/pack2x16unorm/
language: en
---

# `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/core/ir'`

This export returns an IR node. A `"use typeshade"` file calls the builtin itself: [`pack2x16unorm()`](https://typeshade.dev/reference/functions/pack2x16unorm/)

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

## Syntax

```ts
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`](https://typeshade.dev/api/pack4x8unorm/). Spelled `packUnorm2x16` on GLSL ES 3.00.

## Targets

| Target | Support | Notes |
| --- | --- | --- |
| WGSL (WebGPU) | Supported | `pack2x16unorm(v)`. |
| GLSL ES 3.00 (WebGL2) | Supported | `packUnorm2x16(v)`. |
| CPU oracle | Supported | Evaluated in `f64` by the oracle. |

## See also

- [`pack2x16unorm()`](https://typeshade.dev/reference/functions/pack2x16unorm/)
- [`pack4x8unorm`](https://typeshade.dev/api/pack4x8unorm/)

## Source

[`src/core/ir/node.ts`, line 1662](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L1662), at commit af54ddad5
