---
title: "OverrideDecl: interface in IR, TypeShade API reference"
description: "OverrideDecl, an interface in IR. A pipeline specialization constant, the declaration behind overrideConst."
url: https://typeshade.dev/api/overridedecl/
language: en
---

# `OverrideDecl`

Interface in IR

A pipeline specialization constant, the declaration behind overrideConst.

`import type { OverrideDecl } from 'typeshade'`
`import type { OverrideDecl } from 'typeshade/core/ir'`

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

## Syntax

```ts
interface OverrideDecl {
  readonly name: string;
  readonly type: ShaderType;
  readonly default: number | boolean;
}
```

## Description

On WGSL it emits a module-scope `override name: type = default;`, which the host specializes through `createRenderPipeline({ constants: { name } })`. On GLSL ES 3.00 it emits `#define name default` after the `#version` line, and the host specializes it by emitting again with `emitGlslModule(m, stage, { overrideValues })`. The value is chosen when the pipeline is created, so a single authored module yields as many driver-specialized variants as the host needs, and the driver eliminates the branches a constant turns dead. Only WGSL scalar types are allowed (`bool`, `i32`, `u32`, `f32`); a vector, matrix, array or struct type is rejected at authoring with [`SD0014`](https://typeshade.dev/reference/errors/sd0014/).

## Instance properties

**`name` read only `string`**

**`type` read only `ShaderType`**

**`default` read only `number | boolean`**

The default value emitted into the `override` declaration or `#define`: the value a pipeline gets when the host supplies nothing for this constant.

## See also

- [`overrideConst`](https://typeshade.dev/api/overrideconst/)

## Source

[`src/core/ir/nodes/host-interface-decls.ts`, line 13](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/nodes/host-interface-decls.ts#L13), at commit af54ddad5
