mat2x2f
On this page

mat2x2f

Function

Builds a mat2x2f, the same type as mat2x2 under WGSL's predeclared alias, in the same four ways: from 2 vec2 columns, from 4 components column by column, from a larger matrix by truncation, or with no arguments for the zero matrix (§40).

The signature and the sentence under each name are the compiler's own text at commit 26de7be8.

Syntax

declare function mat2x2f(): mat2x2
declare function mat2x2f(c0: vec2, c1: vec2): mat2x2
declare function mat2x2f(e0: number, e1: number, e2: number, e3: number): mat2x2
declare function mat2x2f(m: mat2x2): mat2x2
declare function mat2x2f(m: mat2x3): mat2x2
declare function mat2x2f(m: mat2x4): mat2x2
declare function mat2x2f(m: mat3x2): mat2x2
declare function mat2x2f(m: mat3x3): mat2x2
declare function mat2x2f(m: mat3x4): mat2x2
declare function mat2x2f(m: mat4x2): mat2x2
declare function mat2x2f(m: mat4x3): mat2x2
declare function mat2x2f(m: mat4x4): mat2x2

A number in a parameter or a return position is the scalar slot. The ambient file declares a GPU scalar as a branded number whose brand is optional, so a literal and any branded scalar both fill it.

type f32 = number & { readonly [f32Tag]?: true }

A declaration you write still needs a width, and a bare number on a field or a parameter is refused; the TypeScript constructs page carries that row with the compiler's own message.

Parameters

Return value

mat2x2

See also

Edit this page Report a problem