---
title: "dpdy(): IR builder function in typeshade/core/ir, TypeShade"
description: "dpdy, an IR builder function in typeshade/core/ir. dpdy(x): the screen-space partial derivative of x along the Y axis, component-wise; the partner of dpdx…"
url: https://typeshade.dev/api/dpdy/
language: en
---

# `dpdy()`

Function in Builtins

`dpdy(x)`: the screen-space partial derivative of x along the Y axis, component-wise; the partner of dpdx, with the same GPU-only and fragment-only constraints.

`import { dpdy } from 'typeshade/core/ir'`

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

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

## Syntax

```ts
const dpdy: <K extends FloatKey>(x: ReadonlyNode<K>) => Node<K>
```

## Parameters

**`x` `ReadonlyNode<K>`**

## Return value

`Node<K>`

## Description

Spelled `dpdy` on WGSL and `dFdy` on GLSL ES 3.00.

## Examples

### Example

```ts
import { fn, dpdy, f32T } from 'typeshade/core/ir'

const dv = fn('dv', { v: f32T }, ({ v }) => dpdy(v))
```

## Targets

| Target | Support | Notes |
| --- | --- | --- |
| WGSL (WebGPU) | Supported | `dpdy(x)`. |
| GLSL ES 3.00 (WebGL2) | Supported | `dFdy(x)`. |
| CPU oracle | Stub | The oracle has no texture memory and no neighbouring fragments. The call throws unless the module was compiled with `{ gpuStubs: true }`, which returns a placeholder. |

## In the guide

- [Layouts and resources](https://typeshade.dev/guide/internals/layouts-and-resources/)
- [The CPU oracle](https://typeshade.dev/guide/internals/the-cpu-oracle/)

## See also

- [`dpdy()`](https://typeshade.dev/reference/functions/dpdy/)
- [`dpdx`](https://typeshade.dev/api/dpdx/)

## Source

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