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

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

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

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/core/ir'
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 1993, at commit af54ddad5

Edit this page Report a problem