dpdy
On this page

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'

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

Syntax

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

import { fn, dpdy, f32T } from 'typeshade'
const dv = fn('dv', { v: f32T }, ({ v }) => dpdy(v))

Targets

TargetSupportNotes
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

See also

Source

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

Edit this page Report a problem