---
title: "overrideRef(): IR builder function in typeshade/core/ir"
description: "overrideRef, an IR builder function in typeshade/core/ir. A read of a pipeline specialization constant, the read side of an overrideConst(...) declaration."
url: https://typeshade.dev/api/overrideref/
language: en
---

# `overrideRef()`

Function in Values

A read of a pipeline specialization constant, the read side of an overrideConst(...) declaration.

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

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

## Syntax

```ts
function overrideRef<T extends ShaderType>(name: string, type: T): ReadonlyNode<KeyOf<T>>
```

## Parameters

**`name` `string`**

**`type` `T extends ShaderType`**

## Return value

`ReadonlyNode<KeyOf<T>>`

## Description

The result is a [`ReadonlyNode`](https://typeshade.dev/api/readonlynode/), and the optimizer treats it as opaque: the value is symbolic until pipeline creation, so no folding or dead-branch pass may collapse a branch it guards. Authoring code reads through the handle `overrideConst` returns; this is the primitive behind that handle.

## See also

- [`ReadonlyNode`](https://typeshade.dev/api/readonlynode/)

## Source

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