externRef
On this page

externRef()

Function in Values

A read of a global the host provides, the read side of an externVar(...) declaration and the variable counterpart of an externFn call.

import { externRef } from 'typeshade'

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

Syntax

function externRef<T extends ShaderType>(name: string, type: T): ReadonlyNode<KeyOf<T>>

Parameters

name string
type T extends ShaderType

Return value

ReadonlyNode<KeyOf<T>>

Description

A read of a global the host provides, the read side of an externVar(...) declaration and the variable counterpart of an externFn call. It is read-only: the host owns the value. The optimizer treats it as opaque, like overrideRef: the value is unknown when the module is built, so no folding or dead-branch pass may collapse a branch it guards. Authoring code reads through the handle externVar returns; this is the primitive behind that handle.

See also

Source

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

Edit this page Report a problem