matT
On this page

matT()

Function in Types

Any matCxR<f32> or matCxR<f64>: cols columns of rows components each, column-major as both targets are.

import { matT } from 'typeshade'

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

Syntax

const matT: (
cols: 2 | 3 | 4,
rows: 2 | 3 | 4,
elem?: "f32" | "f64",
) => Extract<ShaderType, { kind: "mat"; }>

Parameters

cols 2 | 3 | 4

Number of columns — the C of matCxR.

rows 2 | 3 | 4

Number of rows — the R of matCxR, and the component count of one column.

elemoptional 'f32' | 'f64'

'f32' for a native matrix, 'f64' for the emulated-double one (square only).

Return value

Extract<ShaderType, { kind: 'mat' }>

Description

The named constants above are the shapes with a spelling of their own; this is how the front end and a host build the other six.

Examples

Example

import { matT, typeKey } from 'typeshade'
typeKey(matT(2, 3)) // 'mat2x3<f32>'

Source

src/core/ir/types.ts, line 535, at commit 26de7be8

Edit this page Report a problem