---
title: "DERIVATIVE_INTRINSICS: constant in Backends, TypeShade API"
description: "DERIVATIVE_INTRINSICS, a constant in Backends. The intrinsics whose value is a difference between neighbouring invocations…"
url: https://typeshade.dev/api/derivativeintrinsics/
language: en
---

# `DERIVATIVE_INTRINSICS`

Constant in Backends

The intrinsics whose value is a difference between neighbouring invocations, so WGSL requires uniform control flow at the call: the derivatives themselves and every sampling form that derives its level of detail implicitly.

`import { DERIVATIVE_INTRINSICS } from 'typeshade'`

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

## Syntax

```ts
const DERIVATIVE_INTRINSICS: ReadonlySet<string>
```

## Description

Derived from the catalogue above rather than listed, so a sampling id added there joins by construction: every `textureSample…` id that is not an explicit-`Level` or `Grad` form needs the implicit LOD, and `dpdx` / `dpdy` / `fwidth` and their `Coarse` and `Fine` variants are the derivative. `textureSampleLevel`, `textureSampleGrad` and `textureSampleCompareLevel` carry the level the author wrote and are therefore legal anywhere — which is why the diagnostic for one of these names them as the fix.

Not the same question as `fragment-only-builtin`’s `FRAGMENT_ONLY_IDS`, which asks which stage may reach an id and carries a per-id fix string; that map is a subset of this set, pinned by a test rather than derived, because a fix sentence is written, not computed.

## Source

[`src/core/intrinsics.ts`, line 1289](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/intrinsics.ts#L1289), at commit af54ddad5
