# Xui.GPU.Shaders.Types

Assembly: **Xui.Core** · [C# declarations](index.cs) · [Assembly overview](../index.md)

## Types

- [`enum AddressMode`](#api-41060a5b76ce8beb)
- [`readonly struct Bool`](#api-8bca3cb3f1ca76be)
- [`struct Color4`](#api-00b7786b4d10f25d)
- [`readonly struct F32`](#api-afc5625f4ca94072)
- [`enum FilterMode`](#api-b7d1f7f8d4fd9e3a)
- [`struct Float2`](#api-382c6499aa4a145c)
- [`struct Float3`](#api-5c74e6f59efcac1f)
- [`struct Float4`](#api-f837356feaa637f6)
- [`struct Float4x4`](#api-4ea8deb8bc216e56)
- [`readonly struct I32`](#api-7007f635dfbf492f)
- [`interface ISampledTexture<TPixel>`](#api-f61c5921b988328f)
- [`struct Int2`](#api-5fee63c65fa50de5)
- [`readonly struct Sampler`](#api-386c3feb8f1e7dbf)
- [`readonly struct Texture2D<TPixel>`](#api-7b558081916875ff)
- [`readonly struct U32`](#api-750b7626796cb92c)

<a id="api-41060a5b76ce8beb"></a>

## `enum AddressMode`

Represents texture sampling addressing modes.

```csharp
public enum AddressMode
{
    Repeat,
    ClampToEdge,
    MirroredRepeat,
    ClampToBorder,
}
```

<a id="api-f0d06a74fc8d5eed"></a>

### [`AddressMode.ClampToBorder`](#api-f0d06a74fc8d5eed)


```csharp
ClampToBorder
```

Texture coordinates outside [0, 1] return a border color.

<a id="api-eb421dedcd090bbb"></a>

### [`AddressMode.ClampToEdge`](#api-eb421dedcd090bbb)


```csharp
ClampToEdge
```

Texture coordinates are clamped to the edge.

<a id="api-033da398b2836001"></a>

### [`AddressMode.MirroredRepeat`](#api-033da398b2836001)


```csharp
MirroredRepeat
```

Texture coordinates mirror at the boundaries.

<a id="api-88652518941e33df"></a>

### [`AddressMode.Repeat`](#api-88652518941e33df)


```csharp
Repeat
```

Texture coordinates wrap at the boundaries (repeat).


<a id="api-8bca3cb3f1ca76be"></a>

## `readonly struct Bool`

Shader boolean type.

```csharp
public readonly struct Bool
{
    public Bool(bool value);
    public static Bool False { get; }
    public static Bool True { get; }

    public static implicit operator Bool(bool value);
    public static implicit operator bool (Bool value);
    public static Bool operator ==(Bool left, Bool right);
    public static Bool operator !=(Bool left, Bool right);
    public static Bool operator &(Bool left, Bool right);
    public static Bool operator |(Bool left, Bool right);
    public static Bool operator !(Bool value);
    public override bool Equals(object? obj);
    public override int GetHashCode();
    public override string ToString();
}
```

<a id="api-df2960fd04950317"></a>

### [`Bool.Bool(bool value)`](#api-df2960fd04950317)


```csharp
public Bool(bool value);
```

Initializes a new instance of the [`Xui.GPU.Shaders.Types.Bool`](../xui-gpu-shaders-types/index.md#api-8bca3cb3f1ca76be) struct.

- **`value`** — The bool value.

<a id="api-9a341cc3ac4aebe9"></a>

### [`bool Bool.Equals(object? obj)`](#api-9a341cc3ac4aebe9)


```csharp
public override bool Equals(object? obj);
```

Indicates whether this instance and a specified object are equal.

- **`obj`** — The object to compare with the current instance.

**Returns:** `true` if `obj` and this instance are the same type and represent the same value; otherwise, `false`.

<a id="api-95a7d8fbe7a2848d"></a>

### [`Bool Bool.False`](#api-95a7d8fbe7a2848d)


```csharp
public static Bool False { get; }
```

Gets the false constant.

<a id="api-c688d320073259d7"></a>

### [`int Bool.GetHashCode()`](#api-c688d320073259d7)


```csharp
public override int GetHashCode();
```

Returns the hash code for this instance.

**Returns:** A 32-bit signed integer that is the hash code for this instance.

<a id="api-34acabbd7cc58ee0"></a>

### [`string Bool.ToString()`](#api-34acabbd7cc58ee0)


```csharp
public override string ToString();
```

Returns the fully qualified type name of this instance.

**Returns:** The fully qualified type name.

<a id="api-2e786e43db0c48b9"></a>

### [`Bool Bool.True`](#api-2e786e43db0c48b9)


```csharp
public static Bool True { get; }
```

Gets the true constant.

<a id="api-1585d4f8a35f5c16"></a>

### [`Bool Bool.operator &(Bool left, Bool right)`](#api-1585d4f8a35f5c16)


```csharp
public static Bool operator &(Bool left, Bool right);
```

Performs logical AND of two Bool values.

<a id="api-5cbd52038e10bc2d"></a>

### [`Bool Bool.operator |(Bool left, Bool right)`](#api-5cbd52038e10bc2d)


```csharp
public static Bool operator |(Bool left, Bool right);
```

Performs logical OR of two Bool values.

<a id="api-57954f75bd4fcf68"></a>

### [`Bool Bool.operator ==(Bool left, Bool right)`](#api-57954f75bd4fcf68)


```csharp
public static Bool operator ==(Bool left, Bool right);
```

Tests equality of two Bool values.

<a id="api-7873be8fc86b2bfc"></a>

### [`Bool.implicit operator Bool(bool value)`](#api-7873be8fc86b2bfc)


```csharp
public static implicit operator Bool(bool value);
```

Converts from bool to Bool.

<a id="api-4a4eee1cafb7213f"></a>

### [`Bool.implicit operator bool(Bool value)`](#api-4a4eee1cafb7213f)


```csharp
public static implicit operator bool (Bool value);
```

Converts from Bool to bool.

<a id="api-1bda8cd5419a3a8d"></a>

### [`Bool Bool.operator !=(Bool left, Bool right)`](#api-1bda8cd5419a3a8d)


```csharp
public static Bool operator !=(Bool left, Bool right);
```

Tests inequality of two Bool values.

<a id="api-149b0444dff752d1"></a>

### [`Bool Bool.operator !(Bool value)`](#api-149b0444dff752d1)


```csharp
public static Bool operator !(Bool value);
```

Performs logical NOT of a Bool value.


<a id="api-00b7786b4d10f25d"></a>

## `struct Color4`

A 4-component RGBA color value.

```csharp
public struct Color4
{
    public F32 R;
    public F32 G;
    public F32 B;
    public F32 A;
    public Color4(F32 r, F32 g, F32 b, F32 a);
    public Color4(F32 r, F32 g, F32 b);
    public static Color4 White { get; }
    public static Color4 Black { get; }
    public static Color4 Transparent { get; }

    public static Color4 operator +(Color4 a, Color4 b);
    public static Color4 operator *(Color4 left, Color4 right);
    public static Color4 operator *(Color4 left, F32 right);
    public static implicit operator Color4(Xui.Core.Canvas.Color color);
    public static implicit operator Color4(uint rgba);
    public override string ToString();
}
```

<a id="api-644e7aeaa3f569f8"></a>

### [`Color4.Color4(F32 r, F32 g, F32 b)`](#api-644e7aeaa3f569f8)


```csharp
public Color4(F32 r, F32 g, F32 b);
```

Initializes a new instance from RGB values with alpha set to 1.

<a id="api-34d211548a880c04"></a>

### [`Color4.Color4(F32 r, F32 g, F32 b, F32 a)`](#api-34d211548a880c04)


```csharp
public Color4(F32 r, F32 g, F32 b, F32 a);
```

Initializes a new instance of the [`Xui.GPU.Shaders.Types.Color4`](../xui-gpu-shaders-types/index.md#api-00b7786b4d10f25d) struct.

<a id="api-6492407d59615350"></a>

### [`F32 Color4.A`](#api-6492407d59615350)


```csharp
public F32 A;
```

The alpha component.

<a id="api-3949ef362b740bc0"></a>

### [`F32 Color4.B`](#api-3949ef362b740bc0)


```csharp
public F32 B;
```

The blue component.

<a id="api-e539eaab543eec75"></a>

### [`Color4 Color4.Black`](#api-e539eaab543eec75)


```csharp
public static Color4 Black { get; }
```

Gets a black color (0, 0, 0, 1).

<a id="api-bb849752b03f8d8a"></a>

### [`F32 Color4.G`](#api-bb849752b03f8d8a)


```csharp
public F32 G;
```

The green component.

<a id="api-28a20e1a7da8c3c3"></a>

### [`F32 Color4.R`](#api-28a20e1a7da8c3c3)


```csharp
public F32 R;
```

The red component.

<a id="api-c4a851efbf211c7a"></a>

### [`string Color4.ToString()`](#api-c4a851efbf211c7a)


```csharp
public override string ToString();
```

Returns the fully qualified type name of this instance.

**Returns:** The fully qualified type name.

<a id="api-6c30db180e616b7f"></a>

### [`Color4 Color4.Transparent`](#api-6c30db180e616b7f)


```csharp
public static Color4 Transparent { get; }
```

Gets a transparent color (0, 0, 0, 0).

<a id="api-48206de35fdae725"></a>

### [`Color4 Color4.White`](#api-48206de35fdae725)


```csharp
public static Color4 White { get; }
```

Gets a white color (1, 1, 1, 1).

<a id="api-816b306eff6f7c3d"></a>

### [`Color4 Color4.operator +(Color4 a, Color4 b)`](#api-816b306eff6f7c3d)


```csharp
public static Color4 operator +(Color4 a, Color4 b);
```

Adds color components without clamping.

<a id="api-0805997a9e508475"></a>

### [`Color4.implicit operator Color4(uint rgba)`](#api-0805997a9e508475)


```csharp
public static implicit operator Color4(uint rgba);
```

Implicitly converts a packed 32-bit RGBA value (0xRRGGBBAA) to a [`Xui.GPU.Shaders.Types.Color4`](../xui-gpu-shaders-types/index.md#api-00b7786b4d10f25d). Compatible with Xui.Core.Canvas.Colors web color constants.

<a id="api-686bbe12a3442526"></a>

### [`Color4.implicit operator Color4(Color color)`](#api-686bbe12a3442526)


```csharp
public static implicit operator Color4(Xui.Core.Canvas.Color color);
```

Implicitly converts from [`Xui.Core.Canvas.Color`](../xui-core-canvas/index.md#api-5fe2e13064a570d1) to [`Xui.GPU.Shaders.Types.Color4`](../xui-gpu-shaders-types/index.md#api-00b7786b4d10f25d).

<a id="api-6a6f3762bc5fd316"></a>

### [`Color4 Color4.operator *(Color4 left, Color4 right)`](#api-6a6f3762bc5fd316)


```csharp
public static Color4 operator *(Color4 left, Color4 right);
```

Multiplies two colors component-wise.

<a id="api-adaf326570c18af5"></a>

### [`Color4 Color4.operator *(Color4 left, F32 right)`](#api-adaf326570c18af5)


```csharp
public static Color4 operator *(Color4 left, F32 right);
```

Multiplies a color by a scalar.


<a id="api-afc5625f4ca94072"></a>

## `readonly struct F32`

Shader 32-bit floating-point scalar type. This is the fundamental scalar type for shader math operations.

In CPU execution, this may be represented as a single float (in vertex stage) or as a quad of floats (in fragment stage for derivative support).

```csharp
public readonly struct F32
{
    public F32(float value);
    public static F32 Zero { get; }
    public static F32 One { get; }

    public static implicit operator F32(float value);
    public static implicit operator F32(double value);
    public static implicit operator F32(nfloat value);
    public static implicit operator float (F32 value);
    public static implicit operator double (F32 value);
    public static implicit operator nfloat(F32 value);
    public static F32 operator +(F32 left, F32 right);
    public static F32 operator -(F32 left, F32 right);
    public static F32 operator *(F32 left, F32 right);
    public static F32 operator /(F32 left, F32 right);
    public static F32 operator -(F32 value);
    public static Bool operator ==(F32 left, F32 right);
    public static Bool operator !=(F32 left, F32 right);
    public static Bool operator <(F32 left, F32 right);
    public static Bool operator>(F32 left, F32 right);
    public static Bool operator <=(F32 left, F32 right);
    public static Bool operator >=(F32 left, F32 right);
    public override bool Equals(object? obj);
    public override int GetHashCode();
    public override string ToString();
}
```

<a id="api-5e7801a2092befde"></a>

### [`F32.F32(float value)`](#api-5e7801a2092befde)


```csharp
public F32(float value);
```

Initializes a new instance of the [`Xui.GPU.Shaders.Types.F32`](../xui-gpu-shaders-types/index.md#api-afc5625f4ca94072) struct.

- **`value`** — The float value.

<a id="api-2dcf664981229e04"></a>

### [`bool F32.Equals(object? obj)`](#api-2dcf664981229e04)


```csharp
public override bool Equals(object? obj);
```

Indicates whether this instance and a specified object are equal.

- **`obj`** — The object to compare with the current instance.

**Returns:** `true` if `obj` and this instance are the same type and represent the same value; otherwise, `false`.

<a id="api-6cb30837ed94828b"></a>

### [`int F32.GetHashCode()`](#api-6cb30837ed94828b)


```csharp
public override int GetHashCode();
```

Returns the hash code for this instance.

**Returns:** A 32-bit signed integer that is the hash code for this instance.

<a id="api-32c893b3d6a4f9a7"></a>

### [`F32 F32.One`](#api-32c893b3d6a4f9a7)


```csharp
public static F32 One { get; }
```

Gets the one constant.

<a id="api-3b5ea8881e1d609e"></a>

### [`string F32.ToString()`](#api-3b5ea8881e1d609e)


```csharp
public override string ToString();
```

Returns the fully qualified type name of this instance.

**Returns:** The fully qualified type name.

<a id="api-b4734315731b47ad"></a>

### [`F32 F32.Zero`](#api-b4734315731b47ad)


```csharp
public static F32 Zero { get; }
```

Gets the zero constant.

<a id="api-41bf9afc32525ee0"></a>

### [`F32 F32.operator +(F32 left, F32 right)`](#api-41bf9afc32525ee0)


```csharp
public static F32 operator +(F32 left, F32 right);
```

Adds two F32 values.

<a id="api-16eb2e67a813e2fa"></a>

### [`F32 F32.operator /(F32 left, F32 right)`](#api-16eb2e67a813e2fa)


```csharp
public static F32 operator /(F32 left, F32 right);
```

Divides two F32 values.

<a id="api-5c7f2efabecfe489"></a>

### [`Bool F32.operator ==(F32 left, F32 right)`](#api-5c7f2efabecfe489)


```csharp
public static Bool operator ==(F32 left, F32 right);
```

Tests equality of two F32 values.

<a id="api-379aea6597df7020"></a>

### [`Bool F32.operator >(F32 left, F32 right)`](#api-379aea6597df7020)


```csharp
public static Bool operator>(F32 left, F32 right);
```

Tests if left is greater than right.

<a id="api-7a297363bde15e97"></a>

### [`Bool F32.operator >=(F32 left, F32 right)`](#api-7a297363bde15e97)


```csharp
public static Bool operator >=(F32 left, F32 right);
```

Tests if left is greater than or equal to right.

<a id="api-0158bcef26c1ee28"></a>

### [`F32.implicit operator F32(double value)`](#api-0158bcef26c1ee28)


```csharp
public static implicit operator F32(double value);
```

Converts from double to F32 (narrowing).

<a id="api-c5dac21e0dd19db9"></a>

### [`F32.implicit operator F32(NFloat value)`](#api-c5dac21e0dd19db9)


```csharp
public static implicit operator F32(nfloat value);
```

Converts from nfloat to F32.

<a id="api-d3b5dc3135ac11b1"></a>

### [`F32.implicit operator F32(float value)`](#api-d3b5dc3135ac11b1)


```csharp
public static implicit operator F32(float value);
```

Converts from float to F32.

<a id="api-8bfa3778c6306555"></a>

### [`F32.implicit operator double(F32 value)`](#api-8bfa3778c6306555)


```csharp
public static implicit operator double (F32 value);
```

Converts from F32 to double.

<a id="api-dd4b071033d342a2"></a>

### [`F32.implicit operator NFloat(F32 value)`](#api-dd4b071033d342a2)


```csharp
public static implicit operator nfloat(F32 value);
```

Converts from F32 to nfloat.

<a id="api-79bd890a27f8edf0"></a>

### [`F32.implicit operator float(F32 value)`](#api-79bd890a27f8edf0)


```csharp
public static implicit operator float (F32 value);
```

Converts from F32 to float.

<a id="api-7a02f0915ed287cc"></a>

### [`Bool F32.operator !=(F32 left, F32 right)`](#api-7a02f0915ed287cc)


```csharp
public static Bool operator !=(F32 left, F32 right);
```

Tests inequality of two F32 values.

<a id="api-9d48018aeade7f44"></a>

### [`Bool F32.operator <(F32 left, F32 right)`](#api-9d48018aeade7f44)


```csharp
public static Bool operator <(F32 left, F32 right);
```

Tests if left is less than right.

<a id="api-a3bcd1110e004f3c"></a>

### [`Bool F32.operator <=(F32 left, F32 right)`](#api-a3bcd1110e004f3c)


```csharp
public static Bool operator <=(F32 left, F32 right);
```

Tests if left is less than or equal to right.

<a id="api-bdc240da3b2119c0"></a>

### [`F32 F32.operator *(F32 left, F32 right)`](#api-bdc240da3b2119c0)


```csharp
public static F32 operator *(F32 left, F32 right);
```

Multiplies two F32 values.

<a id="api-32e086d1c2d4a3bc"></a>

### [`F32 F32.operator -(F32 left, F32 right)`](#api-32e086d1c2d4a3bc)


```csharp
public static F32 operator -(F32 left, F32 right);
```

Subtracts two F32 values.

<a id="api-3e8b0dd789cf0255"></a>

### [`F32 F32.operator -(F32 value)`](#api-3e8b0dd789cf0255)


```csharp
public static F32 operator -(F32 value);
```

Negates an F32 value.


<a id="api-b7d1f7f8d4fd9e3a"></a>

## `enum FilterMode`

Represents texture sampling filter modes.

```csharp
public enum FilterMode
{
    Point,
    Linear,
}
```

<a id="api-d49dd23fc2804404"></a>

### [`FilterMode.Linear`](#api-d49dd23fc2804404)


```csharp
Linear
```

Linear (bilinear) sampling.

<a id="api-4a43ee9785ae05ed"></a>

### [`FilterMode.Point`](#api-4a43ee9785ae05ed)


```csharp
Point
```

Point (nearest neighbor) sampling.


<a id="api-382c6499aa4a145c"></a>

## `struct Float2`

A 2-component vector of 32-bit floats.

```csharp
public struct Float2
{
    public F32 X;
    public F32 Y;
    public Float2(F32 x, F32 y);
    public Float2(F32 value);
    public static Float2 Zero { get; }
    public static Float2 One { get; }

    public static Float2 operator +(Float2 left, Float2 right);
    public static Float2 operator -(Float2 left, Float2 right);
    public static Float2 operator *(Float2 left, Float2 right);
    public static Float2 operator *(Float2 left, F32 right);
    public static Float2 operator *(F32 left, Float2 right);
    public static Float2 operator /(Float2 left, Float2 right);
    public static Float2 operator /(Float2 left, F32 right);
    public static Float2 operator -(Float2 value);
    public readonly Float2 XX { get; }
    public readonly Float2 XY { get; }
    public readonly Float2 YX { get; }
    public readonly Float2 YY { get; }

    public static implicit operator Float2(Xui.Core.Math2D.Point point);
    public static implicit operator Float2(Xui.Core.Math2D.Vector vector);
    public static implicit operator Float2(Xui.Core.Math2D.Size size);
    public override string ToString();
}
```

<a id="api-975d00a968833ce0"></a>

### [`Float2.Float2(F32 value)`](#api-975d00a968833ce0)


```csharp
public Float2(F32 value);
```

Initializes a new instance with both components set to the same value.

<a id="api-61e60c755e036e99"></a>

### [`Float2.Float2(F32 x, F32 y)`](#api-61e60c755e036e99)


```csharp
public Float2(F32 x, F32 y);
```

Initializes a new instance of the [`Xui.GPU.Shaders.Types.Float2`](../xui-gpu-shaders-types/index.md#api-382c6499aa4a145c) struct.

<a id="api-1bdb9a941bf4a41a"></a>

### [`Float2 Float2.One`](#api-1bdb9a941bf4a41a)


```csharp
public static Float2 One { get; }
```

Gets the one vector.

<a id="api-4e7c80d3f8c63441"></a>

### [`string Float2.ToString()`](#api-4e7c80d3f8c63441)


```csharp
public override string ToString();
```

Returns the fully qualified type name of this instance.

**Returns:** The fully qualified type name.

<a id="api-3a450901c7d1bc82"></a>

### [`F32 Float2.X`](#api-3a450901c7d1bc82)


```csharp
public F32 X;
```

The X component.

<a id="api-f8b1005079bf5f28"></a>

### [`readonly Float2 Float2.XX`](#api-f8b1005079bf5f28)


```csharp
public readonly Float2 XX { get; }
```

Gets the XX swizzle (X, X).

<a id="api-c43ec45e4a5f275a"></a>

### [`readonly Float2 Float2.XY`](#api-c43ec45e4a5f275a)


```csharp
public readonly Float2 XY { get; }
```

Gets the XY swizzle (X, Y).

<a id="api-4580445f5ba66a2b"></a>

### [`F32 Float2.Y`](#api-4580445f5ba66a2b)


```csharp
public F32 Y;
```

The Y component.

<a id="api-22d99aee7e4e3528"></a>

### [`readonly Float2 Float2.YX`](#api-22d99aee7e4e3528)


```csharp
public readonly Float2 YX { get; }
```

Gets the YX swizzle (Y, X).

<a id="api-767d5f85cc955004"></a>

### [`readonly Float2 Float2.YY`](#api-767d5f85cc955004)


```csharp
public readonly Float2 YY { get; }
```

Gets the YY swizzle (Y, Y).

<a id="api-66ce4d6a56da3877"></a>

### [`Float2 Float2.Zero`](#api-66ce4d6a56da3877)


```csharp
public static Float2 Zero { get; }
```

Gets the zero vector.

<a id="api-8adc6efcb189237f"></a>

### [`Float2 Float2.operator +(Float2 left, Float2 right)`](#api-8adc6efcb189237f)


```csharp
public static Float2 operator +(Float2 left, Float2 right);
```

Adds two vectors.

<a id="api-2f757fae32f86838"></a>

### [`Float2 Float2.operator /(Float2 left, F32 right)`](#api-2f757fae32f86838)


```csharp
public static Float2 operator /(Float2 left, F32 right);
```

Divides a vector by a scalar.

<a id="api-796a34aa3d10fce4"></a>

### [`Float2 Float2.operator /(Float2 left, Float2 right)`](#api-796a34aa3d10fce4)


```csharp
public static Float2 operator /(Float2 left, Float2 right);
```

Divides two vectors component-wise.

<a id="api-720bd86324f3e9c8"></a>

### [`Float2.implicit operator Float2(Point point)`](#api-720bd86324f3e9c8)


```csharp
public static implicit operator Float2(Xui.Core.Math2D.Point point);
```

Implicitly converts from [`Xui.Core.Math2D.Point`](../xui-core-math2d/index.md#api-7dfbe8f77fb7adae) to [`Xui.GPU.Shaders.Types.Float2`](../xui-gpu-shaders-types/index.md#api-382c6499aa4a145c).

<a id="api-b9ac7a91bfd8b8d9"></a>

### [`Float2.implicit operator Float2(Size size)`](#api-b9ac7a91bfd8b8d9)


```csharp
public static implicit operator Float2(Xui.Core.Math2D.Size size);
```

Implicitly converts from [`Xui.Core.Math2D.Size`](../xui-core-math2d/index.md#api-348aa93314a72466) to [`Xui.GPU.Shaders.Types.Float2`](../xui-gpu-shaders-types/index.md#api-382c6499aa4a145c).

<a id="api-f4109e52b2286500"></a>

### [`Float2.implicit operator Float2(Vector vector)`](#api-f4109e52b2286500)


```csharp
public static implicit operator Float2(Xui.Core.Math2D.Vector vector);
```

Implicitly converts from [`Xui.Core.Math2D.Vector`](../xui-core-math2d/index.md#api-dc51b72f122240f1) to [`Xui.GPU.Shaders.Types.Float2`](../xui-gpu-shaders-types/index.md#api-382c6499aa4a145c).

<a id="api-da21c238f1177521"></a>

### [`Float2 Float2.operator *(F32 left, Float2 right)`](#api-da21c238f1177521)


```csharp
public static Float2 operator *(F32 left, Float2 right);
```

Multiplies a scalar by a vector.

<a id="api-22203dfebeb4ee64"></a>

### [`Float2 Float2.operator *(Float2 left, F32 right)`](#api-22203dfebeb4ee64)


```csharp
public static Float2 operator *(Float2 left, F32 right);
```

Multiplies a vector by a scalar.

<a id="api-e54074004168c2a0"></a>

### [`Float2 Float2.operator *(Float2 left, Float2 right)`](#api-e54074004168c2a0)


```csharp
public static Float2 operator *(Float2 left, Float2 right);
```

Multiplies two vectors component-wise.

<a id="api-c602bfc707cf6a7c"></a>

### [`Float2 Float2.operator -(Float2 left, Float2 right)`](#api-c602bfc707cf6a7c)


```csharp
public static Float2 operator -(Float2 left, Float2 right);
```

Subtracts two vectors.

<a id="api-0433eca6f2c7a321"></a>

### [`Float2 Float2.operator -(Float2 value)`](#api-0433eca6f2c7a321)


```csharp
public static Float2 operator -(Float2 value);
```

Negates a vector.


<a id="api-5c74e6f59efcac1f"></a>

## `struct Float3`

A 3-component vector of 32-bit floats.

```csharp
public struct Float3
{
    public F32 X;
    public F32 Y;
    public F32 Z;
    public Float3(F32 x, F32 y, F32 z);
    public Float3(F32 value);
    public static Float3 Zero { get; }
    public static Float3 One { get; }

    public static Float3 operator +(Float3 left, Float3 right);
    public static Float3 operator -(Float3 left, Float3 right);
    public static Float3 operator *(Float3 left, Float3 right);
    public static Float3 operator *(Float3 left, F32 right);
    public static Float3 operator *(F32 left, Float3 right);
    public static Float3 operator /(Float3 left, Float3 right);
    public static Float3 operator /(Float3 left, F32 right);
    public static Float3 operator -(Float3 value);
    public static Float3 Cross(Float3 a, Float3 b);
    public static Float3 Normalize(Float3 v);
    public readonly Float2 XY { get; }
    public readonly Float2 XZ { get; }
    public readonly Float2 YX { get; }
    public readonly Float2 YZ { get; }
    public readonly Float2 ZX { get; }
    public readonly Float2 ZY { get; }
    public readonly Float3 XYZ { get; }
    public readonly Float3 XZY { get; }
    public readonly Float3 YXZ { get; }
    public readonly Float3 YZX { get; }
    public readonly Float3 ZXY { get; }
    public readonly Float3 ZYX { get; }

    public override string ToString();
}
```

<a id="api-533e00c5bccdc1cf"></a>

### [`Float3.Float3(F32 value)`](#api-533e00c5bccdc1cf)


```csharp
public Float3(F32 value);
```

Initializes a new instance with all components set to the same value.

<a id="api-85c116938c54b181"></a>

### [`Float3.Float3(F32 x, F32 y, F32 z)`](#api-85c116938c54b181)


```csharp
public Float3(F32 x, F32 y, F32 z);
```

Initializes a new instance of the [`Xui.GPU.Shaders.Types.Float3`](../xui-gpu-shaders-types/index.md#api-5c74e6f59efcac1f) struct.

<a id="api-df8ef3c2f84ae837"></a>

### [`Float3 Float3.Cross(Float3 a, Float3 b)`](#api-df8ef3c2f84ae837)


```csharp
public static Float3 Cross(Float3 a, Float3 b);
```

Computes the cross product of two vectors.

<a id="api-a1325613fd678b4b"></a>

### [`Float3 Float3.Normalize(Float3 v)`](#api-a1325613fd678b4b)


```csharp
public static Float3 Normalize(Float3 v);
```

Normalizes the vector to unit length.

<a id="api-f440c843367a8da5"></a>

### [`Float3 Float3.One`](#api-f440c843367a8da5)


```csharp
public static Float3 One { get; }
```

Gets the one vector.

<a id="api-8174d97b61caf66f"></a>

### [`string Float3.ToString()`](#api-8174d97b61caf66f)


```csharp
public override string ToString();
```

Returns the fully qualified type name of this instance.

**Returns:** The fully qualified type name.

<a id="api-2558e73731c7643b"></a>

### [`F32 Float3.X`](#api-2558e73731c7643b)


```csharp
public F32 X;
```

The X component.

<a id="api-8c513ed5edc80a79"></a>

### [`readonly Float2 Float3.XY`](#api-8c513ed5edc80a79)


```csharp
public readonly Float2 XY { get; }
```

Gets the XY swizzle (X, Y).

<a id="api-84b59456ea55187f"></a>

### [`readonly Float3 Float3.XYZ`](#api-84b59456ea55187f)


```csharp
public readonly Float3 XYZ { get; }
```

Gets the XYZ swizzle (X, Y, Z).

<a id="api-0b479908aed16ac8"></a>

### [`readonly Float2 Float3.XZ`](#api-0b479908aed16ac8)


```csharp
public readonly Float2 XZ { get; }
```

Gets the XZ swizzle (X, Z).

<a id="api-4c1cfcc02f5dea27"></a>

### [`readonly Float3 Float3.XZY`](#api-4c1cfcc02f5dea27)


```csharp
public readonly Float3 XZY { get; }
```

Gets the XZY swizzle (X, Z, Y).

<a id="api-4e1e188b557d28be"></a>

### [`F32 Float3.Y`](#api-4e1e188b557d28be)


```csharp
public F32 Y;
```

The Y component.

<a id="api-591a0d3b4016a227"></a>

### [`readonly Float2 Float3.YX`](#api-591a0d3b4016a227)


```csharp
public readonly Float2 YX { get; }
```

Gets the YX swizzle (Y, X).

<a id="api-cd34d1f0b4ff15de"></a>

### [`readonly Float3 Float3.YXZ`](#api-cd34d1f0b4ff15de)


```csharp
public readonly Float3 YXZ { get; }
```

Gets the YXZ swizzle (Y, X, Z).

<a id="api-2d05413044654e4d"></a>

### [`readonly Float2 Float3.YZ`](#api-2d05413044654e4d)


```csharp
public readonly Float2 YZ { get; }
```

Gets the YZ swizzle (Y, Z).

<a id="api-42b49f5ee8d54006"></a>

### [`readonly Float3 Float3.YZX`](#api-42b49f5ee8d54006)


```csharp
public readonly Float3 YZX { get; }
```

Gets the YZX swizzle (Y, Z, X).

<a id="api-9338bfcebfadfa60"></a>

### [`F32 Float3.Z`](#api-9338bfcebfadfa60)


```csharp
public F32 Z;
```

The Z component.

<a id="api-bb20d61ef3b2515a"></a>

### [`readonly Float2 Float3.ZX`](#api-bb20d61ef3b2515a)


```csharp
public readonly Float2 ZX { get; }
```

Gets the ZX swizzle (Z, X).

<a id="api-f00df87f612b7d6d"></a>

### [`readonly Float3 Float3.ZXY`](#api-f00df87f612b7d6d)


```csharp
public readonly Float3 ZXY { get; }
```

Gets the ZXY swizzle (Z, X, Y).

<a id="api-a8355bef9ec8fc68"></a>

### [`readonly Float2 Float3.ZY`](#api-a8355bef9ec8fc68)


```csharp
public readonly Float2 ZY { get; }
```

Gets the ZY swizzle (Z, Y).

<a id="api-4d9c5e29bc591719"></a>

### [`readonly Float3 Float3.ZYX`](#api-4d9c5e29bc591719)


```csharp
public readonly Float3 ZYX { get; }
```

Gets the ZYX swizzle (Z, Y, X).

<a id="api-7ee109acd51e6dcd"></a>

### [`Float3 Float3.Zero`](#api-7ee109acd51e6dcd)


```csharp
public static Float3 Zero { get; }
```

Gets the zero vector.

<a id="api-89486006dfc32608"></a>

### [`Float3 Float3.operator +(Float3 left, Float3 right)`](#api-89486006dfc32608)


```csharp
public static Float3 operator +(Float3 left, Float3 right);
```

Adds two vectors.

<a id="api-1a1fd253002e7940"></a>

### [`Float3 Float3.operator /(Float3 left, F32 right)`](#api-1a1fd253002e7940)


```csharp
public static Float3 operator /(Float3 left, F32 right);
```

Divides a vector by a scalar.

<a id="api-6435e9fa67e9cf5c"></a>

### [`Float3 Float3.operator /(Float3 left, Float3 right)`](#api-6435e9fa67e9cf5c)


```csharp
public static Float3 operator /(Float3 left, Float3 right);
```

Divides two vectors component-wise.

<a id="api-41ad386b3a9b6cd4"></a>

### [`Float3 Float3.operator *(F32 left, Float3 right)`](#api-41ad386b3a9b6cd4)


```csharp
public static Float3 operator *(F32 left, Float3 right);
```

Multiplies a scalar by a vector.

<a id="api-12ef02f2ac8ae5d9"></a>

### [`Float3 Float3.operator *(Float3 left, F32 right)`](#api-12ef02f2ac8ae5d9)


```csharp
public static Float3 operator *(Float3 left, F32 right);
```

Multiplies a vector by a scalar.

<a id="api-68b1be1275ba2799"></a>

### [`Float3 Float3.operator *(Float3 left, Float3 right)`](#api-68b1be1275ba2799)


```csharp
public static Float3 operator *(Float3 left, Float3 right);
```

Multiplies two vectors component-wise.

<a id="api-a8ff8d60a3c50004"></a>

### [`Float3 Float3.operator -(Float3 left, Float3 right)`](#api-a8ff8d60a3c50004)


```csharp
public static Float3 operator -(Float3 left, Float3 right);
```

Subtracts two vectors.

<a id="api-cc2ca6540bac8cf5"></a>

### [`Float3 Float3.operator -(Float3 value)`](#api-cc2ca6540bac8cf5)


```csharp
public static Float3 operator -(Float3 value);
```

Negates a vector.


<a id="api-f837356feaa637f6"></a>

## `struct Float4`

A 4-component vector of 32-bit floats.

```csharp
public struct Float4
{
    public F32 X;
    public F32 Y;
    public F32 Z;
    public F32 W;
    public Float4(F32 x, F32 y, F32 z, F32 w);
    public Float4(Float2 xy, F32 z, F32 w);
    public Float4(Float3 xyz, F32 w);
    public Float4(F32 value);
    public static Float4 Zero { get; }
    public static Float4 One { get; }

    public static Float4 operator +(Float4 left, Float4 right);
    public static Float4 operator -(Float4 left, Float4 right);
    public static Float4 operator *(Float4 left, Float4 right);
    public static Float4 operator *(Float4 left, F32 right);
    public static Float4 operator *(F32 left, Float4 right);
    public static Float4 operator /(Float4 left, Float4 right);
    public static Float4 operator /(Float4 left, F32 right);
    public static Float4 operator -(Float4 value);
    public readonly Float2 XY { get; }
    public readonly Float2 XZ { get; }
    public readonly Float2 XW { get; }
    public readonly Float2 YZ { get; }
    public readonly Float2 YW { get; }
    public readonly Float2 ZW { get; }
    public readonly Float3 XYZ { get; }
    public readonly Float3 XYW { get; }
    public readonly Float3 XZW { get; }
    public readonly Float3 YZW { get; }
    public readonly Float3 RGB { get; }
    public readonly Float4 XYZW { get; }
    public readonly Float4 RGBA { get; }

    public override string ToString();
}
```

<a id="api-40c8593e391730d8"></a>

### [`Float4.Float4(F32 value)`](#api-40c8593e391730d8)


```csharp
public Float4(F32 value);
```

Initializes a new instance with all components set to the same value.

<a id="api-49a7fbc008349f7e"></a>

### [`Float4.Float4(F32 x, F32 y, F32 z, F32 w)`](#api-49a7fbc008349f7e)


```csharp
public Float4(F32 x, F32 y, F32 z, F32 w);
```

Initializes a new instance of the [`Xui.GPU.Shaders.Types.Float4`](../xui-gpu-shaders-types/index.md#api-f837356feaa637f6) struct.

<a id="api-270a8547c6dfd726"></a>

### [`Float4.Float4(Float2 xy, F32 z, F32 w)`](#api-270a8547c6dfd726)


```csharp
public Float4(Float2 xy, F32 z, F32 w);
```

Initializes a new instance from a Float2 and z, w components.

<a id="api-134d025bd84331dc"></a>

### [`Float4.Float4(Float3 xyz, F32 w)`](#api-134d025bd84331dc)


```csharp
public Float4(Float3 xyz, F32 w);
```

Initializes a new instance from a Float3 and w component.

<a id="api-023021fae872a22b"></a>

### [`Float4 Float4.One`](#api-023021fae872a22b)


```csharp
public static Float4 One { get; }
```

Gets the one vector.

<a id="api-8af3ae3002b39b53"></a>

### [`readonly Float3 Float4.RGB`](#api-8af3ae3002b39b53)


```csharp
public readonly Float3 RGB { get; }
```

Gets the RGB swizzle (X, Y, Z) - color alias for XYZ.

<a id="api-55210800886bd274"></a>

### [`readonly Float4 Float4.RGBA`](#api-55210800886bd274)


```csharp
public readonly Float4 RGBA { get; }
```

Gets the RGBA swizzle (X, Y, Z, W) - color alias for XYZW.

<a id="api-79e8f219840d53b5"></a>

### [`string Float4.ToString()`](#api-79e8f219840d53b5)


```csharp
public override string ToString();
```

Returns the fully qualified type name of this instance.

**Returns:** The fully qualified type name.

<a id="api-18a2b6f23d14f910"></a>

### [`F32 Float4.W`](#api-18a2b6f23d14f910)


```csharp
public F32 W;
```

The W component.

<a id="api-26fb9bf70a7598f9"></a>

### [`F32 Float4.X`](#api-26fb9bf70a7598f9)


```csharp
public F32 X;
```

The X component.

<a id="api-a44d2e8eafd0d281"></a>

### [`readonly Float2 Float4.XW`](#api-a44d2e8eafd0d281)


```csharp
public readonly Float2 XW { get; }
```

Gets the XW swizzle (X, W).

<a id="api-7d819443cae2b6e3"></a>

### [`readonly Float2 Float4.XY`](#api-7d819443cae2b6e3)


```csharp
public readonly Float2 XY { get; }
```

Gets the XY swizzle (X, Y).

<a id="api-30e438884ad71781"></a>

### [`readonly Float3 Float4.XYW`](#api-30e438884ad71781)


```csharp
public readonly Float3 XYW { get; }
```

Gets the XYW swizzle (X, Y, W).

<a id="api-5ae5c54c312a0f8d"></a>

### [`readonly Float3 Float4.XYZ`](#api-5ae5c54c312a0f8d)


```csharp
public readonly Float3 XYZ { get; }
```

Gets the XYZ swizzle (X, Y, Z).

<a id="api-dc7edc3b40a7db30"></a>

### [`readonly Float4 Float4.XYZW`](#api-dc7edc3b40a7db30)


```csharp
public readonly Float4 XYZW { get; }
```

Gets the XYZW swizzle (X, Y, Z, W).

<a id="api-bbc9c63056f10198"></a>

### [`readonly Float2 Float4.XZ`](#api-bbc9c63056f10198)


```csharp
public readonly Float2 XZ { get; }
```

Gets the XZ swizzle (X, Z).

<a id="api-9911cbf347b3cda3"></a>

### [`readonly Float3 Float4.XZW`](#api-9911cbf347b3cda3)


```csharp
public readonly Float3 XZW { get; }
```

Gets the XZW swizzle (X, Z, W).

<a id="api-5466e8d1bebc6321"></a>

### [`F32 Float4.Y`](#api-5466e8d1bebc6321)


```csharp
public F32 Y;
```

The Y component.

<a id="api-91cebfa4cf04baa4"></a>

### [`readonly Float2 Float4.YW`](#api-91cebfa4cf04baa4)


```csharp
public readonly Float2 YW { get; }
```

Gets the YW swizzle (Y, W).

<a id="api-0709ad2fe50556b5"></a>

### [`readonly Float2 Float4.YZ`](#api-0709ad2fe50556b5)


```csharp
public readonly Float2 YZ { get; }
```

Gets the YZ swizzle (Y, Z).

<a id="api-098c2ec5d4d22ea8"></a>

### [`readonly Float3 Float4.YZW`](#api-098c2ec5d4d22ea8)


```csharp
public readonly Float3 YZW { get; }
```

Gets the YZW swizzle (Y, Z, W).

<a id="api-9d95082724abdb5d"></a>

### [`F32 Float4.Z`](#api-9d95082724abdb5d)


```csharp
public F32 Z;
```

The Z component.

<a id="api-742035a1fc52de1a"></a>

### [`readonly Float2 Float4.ZW`](#api-742035a1fc52de1a)


```csharp
public readonly Float2 ZW { get; }
```

Gets the ZW swizzle (Z, W).

<a id="api-6c4ea859d1c9ae54"></a>

### [`Float4 Float4.Zero`](#api-6c4ea859d1c9ae54)


```csharp
public static Float4 Zero { get; }
```

Gets the zero vector.

<a id="api-9e06c83fd8fe7bb8"></a>

### [`Float4 Float4.operator +(Float4 left, Float4 right)`](#api-9e06c83fd8fe7bb8)


```csharp
public static Float4 operator +(Float4 left, Float4 right);
```

Adds two vectors.

<a id="api-299cef4f1fa57cbf"></a>

### [`Float4 Float4.operator /(Float4 left, F32 right)`](#api-299cef4f1fa57cbf)


```csharp
public static Float4 operator /(Float4 left, F32 right);
```

Divides a vector by a scalar.

<a id="api-1c4001ca91e5a24f"></a>

### [`Float4 Float4.operator /(Float4 left, Float4 right)`](#api-1c4001ca91e5a24f)


```csharp
public static Float4 operator /(Float4 left, Float4 right);
```

Divides two vectors component-wise.

<a id="api-5319006dc056413a"></a>

### [`Float4 Float4.operator *(F32 left, Float4 right)`](#api-5319006dc056413a)


```csharp
public static Float4 operator *(F32 left, Float4 right);
```

Multiplies a scalar by a vector.

<a id="api-c3deba6bb779cf68"></a>

### [`Float4 Float4.operator *(Float4 left, F32 right)`](#api-c3deba6bb779cf68)


```csharp
public static Float4 operator *(Float4 left, F32 right);
```

Multiplies a vector by a scalar.

<a id="api-65a6c8f1ee4c8469"></a>

### [`Float4 Float4.operator *(Float4 left, Float4 right)`](#api-65a6c8f1ee4c8469)


```csharp
public static Float4 operator *(Float4 left, Float4 right);
```

Multiplies two vectors component-wise.

<a id="api-e7bebf05d9a3f04f"></a>

### [`Float4 Float4.operator -(Float4 left, Float4 right)`](#api-e7bebf05d9a3f04f)


```csharp
public static Float4 operator -(Float4 left, Float4 right);
```

Subtracts two vectors.

<a id="api-36e53eedd02f0283"></a>

### [`Float4 Float4.operator -(Float4 value)`](#api-36e53eedd02f0283)


```csharp
public static Float4 operator -(Float4 value);
```

Negates a vector.


<a id="api-4ea8deb8bc216e56"></a>

## `struct Float4x4`

A 4x4 matrix of 32-bit floats. Used for transformations in shader code.

```csharp
public struct Float4x4
{
    public Float4 Row0;
    public Float4 Row1;
    public Float4 Row2;
    public Float4 Row3;
    public Float4x4(Float4 row0, Float4 row1, Float4 row2, Float4 row3);
    public static Float4x4 Identity { get; }

    public static Float4 operator *(Float4x4 matrix, Float4 vector);
    public static Float4x4 operator *(Float4x4 left, Float4x4 right);
    public static Float4x4 CreateTranslation(F32 x, F32 y, F32 z);
    public static Float4x4 CreateRotationX(F32 angle);
    public static Float4x4 CreateRotationY(F32 angle);
    public static Float4x4 CreateRotationZ(F32 angle);
    public static Float4x4 CreatePerspective(F32 fovY, F32 aspectRatio, F32 nearPlane, F32 farPlane);
    public static Float4x4 CreateLookAt(Float3 eye, Float3 target, Float3 up);
    public override string ToString();
}
```

<a id="api-24899e87f93448b1"></a>

### [`Float4x4.Float4x4(Float4 row0, Float4 row1, Float4 row2, Float4 row3)`](#api-24899e87f93448b1)


```csharp
public Float4x4(Float4 row0, Float4 row1, Float4 row2, Float4 row3);
```

Initializes a new instance of the [`Xui.GPU.Shaders.Types.Float4x4`](../xui-gpu-shaders-types/index.md#api-4ea8deb8bc216e56) struct.

<a id="api-3482e7e7a933d35c"></a>

### [`Float4x4 Float4x4.CreateLookAt(Float3 eye, Float3 target, Float3 up)`](#api-3482e7e7a933d35c)


```csharp
public static Float4x4 CreateLookAt(Float3 eye, Float3 target, Float3 up);
```

Creates a view matrix (look-at matrix).

<a id="api-63bcafab4d7fb453"></a>

### [`Float4x4 Float4x4.CreatePerspective(F32 fovY, F32 aspectRatio, F32 nearPlane, F32 farPlane)`](#api-63bcafab4d7fb453)


```csharp
public static Float4x4 CreatePerspective(F32 fovY, F32 aspectRatio, F32 nearPlane, F32 farPlane);
```

Creates a perspective projection matrix.

- **`fovY`** — Field of view in the Y direction (in radians).

- **`aspectRatio`** — Aspect ratio (width / height).

- **`nearPlane`** — Near clipping plane distance.

- **`farPlane`** — Far clipping plane distance.

This uses a [0, 1] depth range (DirectX/Vulkan style) instead of OpenGL&#39;s [-1, 1]. The matrix maps the near plane to NDC Z = 0 and far plane to NDC Z = 1.

<a id="api-9bc60e66ee3a76af"></a>

### [`Float4x4 Float4x4.CreateRotationX(F32 angle)`](#api-9bc60e66ee3a76af)


```csharp
public static Float4x4 CreateRotationX(F32 angle);
```

Creates a rotation matrix around the X axis.

<a id="api-cafb3c8445e65fcc"></a>

### [`Float4x4 Float4x4.CreateRotationY(F32 angle)`](#api-cafb3c8445e65fcc)


```csharp
public static Float4x4 CreateRotationY(F32 angle);
```

Creates a rotation matrix around the Y axis.

<a id="api-2f89bda5d6745f5a"></a>

### [`Float4x4 Float4x4.CreateRotationZ(F32 angle)`](#api-2f89bda5d6745f5a)


```csharp
public static Float4x4 CreateRotationZ(F32 angle);
```

Creates a rotation matrix around the Z axis.

<a id="api-8403af6cde08a781"></a>

### [`Float4x4 Float4x4.CreateTranslation(F32 x, F32 y, F32 z)`](#api-8403af6cde08a781)


```csharp
public static Float4x4 CreateTranslation(F32 x, F32 y, F32 z);
```

Creates a translation matrix.

<a id="api-670744812430c46b"></a>

### [`Float4x4 Float4x4.Identity`](#api-670744812430c46b)


```csharp
public static Float4x4 Identity { get; }
```

Gets the identity matrix.

<a id="api-77745c7925215a1f"></a>

### [`Float4 Float4x4.Row0`](#api-77745c7925215a1f)


```csharp
public Float4 Row0;
```

First row of the matrix.

<a id="api-a946478da2bf8550"></a>

### [`Float4 Float4x4.Row1`](#api-a946478da2bf8550)


```csharp
public Float4 Row1;
```

Second row of the matrix.

<a id="api-dc3f74701830b773"></a>

### [`Float4 Float4x4.Row2`](#api-dc3f74701830b773)


```csharp
public Float4 Row2;
```

Third row of the matrix.

<a id="api-b9a1d0ecec141c64"></a>

### [`Float4 Float4x4.Row3`](#api-b9a1d0ecec141c64)


```csharp
public Float4 Row3;
```

Fourth row of the matrix.

<a id="api-39a920abd11a47f5"></a>

### [`string Float4x4.ToString()`](#api-39a920abd11a47f5)


```csharp
public override string ToString();
```

Returns the fully qualified type name of this instance.

**Returns:** The fully qualified type name.

<a id="api-a9af9d33838bde00"></a>

### [`Float4 Float4x4.operator *(Float4x4 matrix, Float4 vector)`](#api-a9af9d33838bde00)


```csharp
public static Float4 operator *(Float4x4 matrix, Float4 vector);
```

Multiplies a matrix by a vector.

<a id="api-6ac2709a14101cfe"></a>

### [`Float4x4 Float4x4.operator *(Float4x4 left, Float4x4 right)`](#api-6ac2709a14101cfe)


```csharp
public static Float4x4 operator *(Float4x4 left, Float4x4 right);
```

Multiplies two matrices.


<a id="api-7007f635dfbf492f"></a>

## `readonly struct I32`

Shader 32-bit signed integer scalar type.

```csharp
public readonly struct I32
{
    public I32(int value);
    public static I32 Zero { get; }
    public static I32 One { get; }

    public static implicit operator I32(int value);
    public static implicit operator int (I32 value);
    public static I32 operator +(I32 left, I32 right);
    public static I32 operator -(I32 left, I32 right);
    public static I32 operator *(I32 left, I32 right);
    public static I32 operator /(I32 left, I32 right);
    public static I32 operator -(I32 value);
    public static Bool operator ==(I32 left, I32 right);
    public static Bool operator !=(I32 left, I32 right);
    public static Bool operator <(I32 left, I32 right);
    public static Bool operator>(I32 left, I32 right);
    public static Bool operator <=(I32 left, I32 right);
    public static Bool operator >=(I32 left, I32 right);
    public static I32 operator &(I32 left, I32 right);
    public static I32 operator |(I32 left, I32 right);
    public static I32 operator ^(I32 left, I32 right);
    public static I32 operator ~(I32 value);
    public static I32 operator <<(I32 left, int right);
    public static I32 operator >>(I32 left, int right);
    public override bool Equals(object? obj);
    public override int GetHashCode();
    public override string ToString();
}
```

<a id="api-51c7b60b1744189c"></a>

### [`I32.I32(int value)`](#api-51c7b60b1744189c)


```csharp
public I32(int value);
```

Initializes a new instance of the [`Xui.GPU.Shaders.Types.I32`](../xui-gpu-shaders-types/index.md#api-7007f635dfbf492f) struct.

- **`value`** — The int value.

<a id="api-279ea89a616fe1b0"></a>

### [`bool I32.Equals(object? obj)`](#api-279ea89a616fe1b0)


```csharp
public override bool Equals(object? obj);
```

Indicates whether this instance and a specified object are equal.

- **`obj`** — The object to compare with the current instance.

**Returns:** `true` if `obj` and this instance are the same type and represent the same value; otherwise, `false`.

<a id="api-12a22737e9b7e200"></a>

### [`int I32.GetHashCode()`](#api-12a22737e9b7e200)


```csharp
public override int GetHashCode();
```

Returns the hash code for this instance.

**Returns:** A 32-bit signed integer that is the hash code for this instance.

<a id="api-6bd854b75d6a8905"></a>

### [`I32 I32.One`](#api-6bd854b75d6a8905)


```csharp
public static I32 One { get; }
```

Gets the one constant.

<a id="api-bd8ecf2bbadf66a4"></a>

### [`string I32.ToString()`](#api-bd8ecf2bbadf66a4)


```csharp
public override string ToString();
```

Returns the fully qualified type name of this instance.

**Returns:** The fully qualified type name.

<a id="api-1e53483eff4bae5d"></a>

### [`I32 I32.Zero`](#api-1e53483eff4bae5d)


```csharp
public static I32 Zero { get; }
```

Gets the zero constant.

<a id="api-f648bdf2d6745950"></a>

### [`I32 I32.operator +(I32 left, I32 right)`](#api-f648bdf2d6745950)


```csharp
public static I32 operator +(I32 left, I32 right);
```

Adds two I32 values.

<a id="api-00081f6187031bcf"></a>

### [`I32 I32.operator &(I32 left, I32 right)`](#api-00081f6187031bcf)


```csharp
public static I32 operator &(I32 left, I32 right);
```

Performs bitwise AND of two I32 values.

<a id="api-f7f73438875ac6b5"></a>

### [`I32 I32.operator |(I32 left, I32 right)`](#api-f7f73438875ac6b5)


```csharp
public static I32 operator |(I32 left, I32 right);
```

Performs bitwise OR of two I32 values.

<a id="api-4977fe16b97df04f"></a>

### [`I32 I32.operator /(I32 left, I32 right)`](#api-4977fe16b97df04f)


```csharp
public static I32 operator /(I32 left, I32 right);
```

Divides two I32 values.

<a id="api-c3bdd0670b17e637"></a>

### [`Bool I32.operator ==(I32 left, I32 right)`](#api-c3bdd0670b17e637)


```csharp
public static Bool operator ==(I32 left, I32 right);
```

Tests equality of two I32 values.

<a id="api-ad70b08b5e434d89"></a>

### [`I32 I32.operator ^(I32 left, I32 right)`](#api-ad70b08b5e434d89)


```csharp
public static I32 operator ^(I32 left, I32 right);
```

Performs bitwise XOR of two I32 values.

<a id="api-82bd8ebe5989c8c1"></a>

### [`Bool I32.operator >(I32 left, I32 right)`](#api-82bd8ebe5989c8c1)


```csharp
public static Bool operator>(I32 left, I32 right);
```

Tests if left is greater than right.

<a id="api-ebd91b0bd2215cbd"></a>

### [`Bool I32.operator >=(I32 left, I32 right)`](#api-ebd91b0bd2215cbd)


```csharp
public static Bool operator >=(I32 left, I32 right);
```

Tests if left is greater than or equal to right.

<a id="api-19c1a9bddb0bee3d"></a>

### [`I32.implicit operator I32(int value)`](#api-19c1a9bddb0bee3d)


```csharp
public static implicit operator I32(int value);
```

Converts from int to I32.

<a id="api-04dbc1a380309cd7"></a>

### [`I32.implicit operator int(I32 value)`](#api-04dbc1a380309cd7)


```csharp
public static implicit operator int (I32 value);
```

Converts from I32 to int.

<a id="api-525cd39263948737"></a>

### [`Bool I32.operator !=(I32 left, I32 right)`](#api-525cd39263948737)


```csharp
public static Bool operator !=(I32 left, I32 right);
```

Tests inequality of two I32 values.

<a id="api-9c418abeb3cf3a13"></a>

### [`I32 I32.operator <<(I32 left, int right)`](#api-9c418abeb3cf3a13)


```csharp
public static I32 operator <<(I32 left, int right);
```

Left shifts an I32 value.

<a id="api-0e2e8b83e3aa2c1c"></a>

### [`Bool I32.operator <(I32 left, I32 right)`](#api-0e2e8b83e3aa2c1c)


```csharp
public static Bool operator <(I32 left, I32 right);
```

Tests if left is less than right.

<a id="api-15db45b6c24516fe"></a>

### [`Bool I32.operator <=(I32 left, I32 right)`](#api-15db45b6c24516fe)


```csharp
public static Bool operator <=(I32 left, I32 right);
```

Tests if left is less than or equal to right.

<a id="api-8e4c2a3fb76e9c27"></a>

### [`I32 I32.operator *(I32 left, I32 right)`](#api-8e4c2a3fb76e9c27)


```csharp
public static I32 operator *(I32 left, I32 right);
```

Multiplies two I32 values.

<a id="api-14273bf4c5be992a"></a>

### [`I32 I32.operator ~(I32 value)`](#api-14273bf4c5be992a)


```csharp
public static I32 operator ~(I32 value);
```

Performs bitwise NOT of an I32 value.

<a id="api-e7f6f64184eddcff"></a>

### [`I32 I32.operator >>(I32 left, int right)`](#api-e7f6f64184eddcff)


```csharp
public static I32 operator >>(I32 left, int right);
```

Right shifts an I32 value.

<a id="api-dc33a37d2f44d738"></a>

### [`I32 I32.operator -(I32 left, I32 right)`](#api-dc33a37d2f44d738)


```csharp
public static I32 operator -(I32 left, I32 right);
```

Subtracts two I32 values.

<a id="api-1a3b94a81d639253"></a>

### [`I32 I32.operator -(I32 value)`](#api-1a3b94a81d639253)


```csharp
public static I32 operator -(I32 value);
```

Negates an I32 value.


<a id="api-f61c5921b988328f"></a>

## `interface ISampledTexture<TPixel>`

CPU implementation of a shader texture resource; pixel storage belongs to the renderer.

- **`TPixel`** — Pixel result type.

```csharp
public interface ISampledTexture<TPixel>
    where TPixel : unmanaged
{
    TPixel Sample(Sampler sampler, Float2 uv, F32 level);
}
```

<a id="api-dca90fe7d33e3a6b"></a>

### [`TPixel ISampledTexture<TPixel>.Sample(Sampler sampler, Float2 uv, F32 level)`](#api-dca90fe7d33e3a6b)


```csharp
TPixel Sample(Sampler sampler, Float2 uv, F32 level);
```

Samples normalized coordinates at an explicit mip level.


<a id="api-5fee63c65fa50de5"></a>

## `struct Int2`

A 2-component vector of 32-bit signed integers.

```csharp
public struct Int2
{
    public I32 X;
    public I32 Y;
    public Int2(I32 x, I32 y);
    public Int2(I32 value);
    public static Int2 Zero { get; }
    public static Int2 One { get; }

    public static Int2 operator +(Int2 left, Int2 right);
    public static Int2 operator -(Int2 left, Int2 right);
    public static Int2 operator *(Int2 left, Int2 right);
    public static Int2 operator *(Int2 left, I32 right);
    public static Int2 operator *(I32 left, Int2 right);
    public static Int2 operator /(Int2 left, Int2 right);
    public static Int2 operator /(Int2 left, I32 right);
    public static Int2 operator -(Int2 value);
    public override string ToString();
}
```

<a id="api-874f09f2dca3ac59"></a>

### [`Int2.Int2(I32 value)`](#api-874f09f2dca3ac59)


```csharp
public Int2(I32 value);
```

Initializes a new instance with both components set to the same value.

<a id="api-63d361cdf6dd9a79"></a>

### [`Int2.Int2(I32 x, I32 y)`](#api-63d361cdf6dd9a79)


```csharp
public Int2(I32 x, I32 y);
```

Initializes a new instance of the [`Xui.GPU.Shaders.Types.Int2`](../xui-gpu-shaders-types/index.md#api-5fee63c65fa50de5) struct.

<a id="api-f2b943209d366fb9"></a>

### [`Int2 Int2.One`](#api-f2b943209d366fb9)


```csharp
public static Int2 One { get; }
```

Gets the one vector.

<a id="api-a2db40941e2c64cd"></a>

### [`string Int2.ToString()`](#api-a2db40941e2c64cd)


```csharp
public override string ToString();
```

Returns the fully qualified type name of this instance.

**Returns:** The fully qualified type name.

<a id="api-a733de64ee834658"></a>

### [`I32 Int2.X`](#api-a733de64ee834658)


```csharp
public I32 X;
```

The X component.

<a id="api-c2103060bcf1991e"></a>

### [`I32 Int2.Y`](#api-c2103060bcf1991e)


```csharp
public I32 Y;
```

The Y component.

<a id="api-1d92ba7ede0176fd"></a>

### [`Int2 Int2.Zero`](#api-1d92ba7ede0176fd)


```csharp
public static Int2 Zero { get; }
```

Gets the zero vector.

<a id="api-f9ba0bb5c119c800"></a>

### [`Int2 Int2.operator +(Int2 left, Int2 right)`](#api-f9ba0bb5c119c800)


```csharp
public static Int2 operator +(Int2 left, Int2 right);
```

Adds two vectors.

<a id="api-6c2d54e091ffd321"></a>

### [`Int2 Int2.operator /(Int2 left, I32 right)`](#api-6c2d54e091ffd321)


```csharp
public static Int2 operator /(Int2 left, I32 right);
```

Divides a vector by a scalar.

<a id="api-c8879543e1f2fca0"></a>

### [`Int2 Int2.operator /(Int2 left, Int2 right)`](#api-c8879543e1f2fca0)


```csharp
public static Int2 operator /(Int2 left, Int2 right);
```

Divides two vectors component-wise.

<a id="api-61977ca2da76a6b1"></a>

### [`Int2 Int2.operator *(I32 left, Int2 right)`](#api-61977ca2da76a6b1)


```csharp
public static Int2 operator *(I32 left, Int2 right);
```

Multiplies a scalar by a vector.

<a id="api-7267ef3a03e89b17"></a>

### [`Int2 Int2.operator *(Int2 left, I32 right)`](#api-7267ef3a03e89b17)


```csharp
public static Int2 operator *(Int2 left, I32 right);
```

Multiplies a vector by a scalar.

<a id="api-63fdd6a163445830"></a>

### [`Int2 Int2.operator *(Int2 left, Int2 right)`](#api-63fdd6a163445830)


```csharp
public static Int2 operator *(Int2 left, Int2 right);
```

Multiplies two vectors component-wise.

<a id="api-53c7d28f73be4953"></a>

### [`Int2 Int2.operator -(Int2 left, Int2 right)`](#api-53c7d28f73be4953)


```csharp
public static Int2 operator -(Int2 left, Int2 right);
```

Subtracts two vectors.

<a id="api-4714adf256018218"></a>

### [`Int2 Int2.operator -(Int2 value)`](#api-4714adf256018218)


```csharp
public static Int2 operator -(Int2 value);
```

Negates a vector.


<a id="api-386c3feb8f1e7dbf"></a>

## `readonly struct Sampler`

Represents a texture sampler that controls how textures are sampled.

Samplers define the filtering and addressing behavior when reading from textures.

```csharp
public readonly struct Sampler
{
    public FilterMode MinFilter { get; init; }
    public FilterMode MagFilter { get; init; }
    public AddressMode AddressU { get; init; }
    public AddressMode AddressV { get; init; }

    public Sampler(FilterMode minFilter = FilterMode.Linear, FilterMode magFilter = FilterMode.Linear, AddressMode addressU = AddressMode.Repeat, AddressMode addressV = AddressMode.Repeat);
    public static Sampler LinearRepeat { get; }
    public static Sampler LinearClamp { get; }
    public static Sampler PointRepeat { get; }
    public static Sampler PointClamp { get; }
}
```

<a id="api-1fd929b1fdf00e96"></a>

### [`Sampler.Sampler(FilterMode minFilter = FilterMode.Linear, FilterMode magFilter = FilterMode.Linear, AddressMode addressU = AddressMode.Repeat, AddressMode addressV = AddressMode.Repeat)`](#api-1fd929b1fdf00e96)


```csharp
public Sampler(FilterMode minFilter = FilterMode.Linear, FilterMode magFilter = FilterMode.Linear, AddressMode addressU = AddressMode.Repeat, AddressMode addressV = AddressMode.Repeat);
```

Initializes a new instance of the [`Xui.GPU.Shaders.Types.Sampler`](../xui-gpu-shaders-types/index.md#api-386c3feb8f1e7dbf) struct.

<a id="api-3ca572bd62d202f5"></a>

### [`AddressMode Sampler.AddressU`](#api-3ca572bd62d202f5)


```csharp
public AddressMode AddressU { get; init; }
```

Gets the addressing mode for the U coordinate.

<a id="api-5361b84ce94bed8d"></a>

### [`AddressMode Sampler.AddressV`](#api-5361b84ce94bed8d)


```csharp
public AddressMode AddressV { get; init; }
```

Gets the addressing mode for the V coordinate.

<a id="api-4f9b096e8b9e332a"></a>

### [`Sampler Sampler.LinearClamp`](#api-4f9b096e8b9e332a)


```csharp
public static Sampler LinearClamp { get; }
```

Gets a default linear sampler with clamp-to-edge addressing.

<a id="api-8629466e193ccbae"></a>

### [`Sampler Sampler.LinearRepeat`](#api-8629466e193ccbae)


```csharp
public static Sampler LinearRepeat { get; }
```

Gets a default linear sampler with repeat addressing.

<a id="api-7cfe619653dd3cbe"></a>

### [`FilterMode Sampler.MagFilter`](#api-7cfe619653dd3cbe)


```csharp
public FilterMode MagFilter { get; init; }
```

Gets the magnification filter mode.

<a id="api-29649183fed75032"></a>

### [`FilterMode Sampler.MinFilter`](#api-29649183fed75032)


```csharp
public FilterMode MinFilter { get; init; }
```

Gets the minification filter mode.

<a id="api-55edd2cba7f7b2c4"></a>

### [`Sampler Sampler.PointClamp`](#api-55edd2cba7f7b2c4)


```csharp
public static Sampler PointClamp { get; }
```

Gets a default point sampler with clamp-to-edge addressing.

<a id="api-2b8ea50ac22829c7"></a>

### [`Sampler Sampler.PointRepeat`](#api-2b8ea50ac22829c7)


```csharp
public static Sampler PointRepeat { get; }
```

Gets a default point sampler with repeat addressing.


<a id="api-7b558081916875ff"></a>

## `readonly struct Texture2D<TPixel>`

Represents a 2D texture resource in shader code.

- **`TPixel`** — The pixel format type (typically Color4).

In CPU execution, this wraps actual texture data. In GPU execution, this will be translated to the appropriate backend texture type.

```csharp
public readonly struct Texture2D<TPixel>
    where TPixel : unmanaged
{
    public Texture2D(object? data);
}
```

<a id="api-9f459cb9d60f671d"></a>

### [`Texture2D<TPixel>.Texture2D(object? data)`](#api-9f459cb9d60f671d)


```csharp
public Texture2D(object? data);
```

Initializes a new instance of the [`Xui.GPU.Shaders.Types.Texture2D`1`](../xui-gpu-shaders-types/index.md#api-7b558081916875ff) struct.

- **`data`** — The underlying texture data (implementation-specific).


<a id="api-750b7626796cb92c"></a>

## `readonly struct U32`

Shader 32-bit unsigned integer scalar type.

```csharp
public readonly struct U32
{
    public U32(uint value);
    public static U32 Zero { get; }
    public static U32 One { get; }

    public static implicit operator U32(uint value);
    public static implicit operator uint (U32 value);
    public static U32 operator +(U32 left, U32 right);
    public static U32 operator -(U32 left, U32 right);
    public static U32 operator *(U32 left, U32 right);
    public static U32 operator /(U32 left, U32 right);
    public static Bool operator ==(U32 left, U32 right);
    public static Bool operator !=(U32 left, U32 right);
    public static Bool operator <(U32 left, U32 right);
    public static Bool operator>(U32 left, U32 right);
    public static Bool operator <=(U32 left, U32 right);
    public static Bool operator >=(U32 left, U32 right);
    public static U32 operator &(U32 left, U32 right);
    public static U32 operator |(U32 left, U32 right);
    public static U32 operator ^(U32 left, U32 right);
    public static U32 operator ~(U32 value);
    public static U32 operator <<(U32 left, int right);
    public static U32 operator >>(U32 left, int right);
    public override bool Equals(object? obj);
    public override int GetHashCode();
    public override string ToString();
}
```

<a id="api-583d2c70e02fad5b"></a>

### [`U32.U32(uint value)`](#api-583d2c70e02fad5b)


```csharp
public U32(uint value);
```

Initializes a new instance of the [`Xui.GPU.Shaders.Types.U32`](../xui-gpu-shaders-types/index.md#api-750b7626796cb92c) struct.

- **`value`** — The uint value.

<a id="api-df8d84e65292c5ce"></a>

### [`bool U32.Equals(object? obj)`](#api-df8d84e65292c5ce)


```csharp
public override bool Equals(object? obj);
```

Indicates whether this instance and a specified object are equal.

- **`obj`** — The object to compare with the current instance.

**Returns:** `true` if `obj` and this instance are the same type and represent the same value; otherwise, `false`.

<a id="api-711f6820a7a89918"></a>

### [`int U32.GetHashCode()`](#api-711f6820a7a89918)


```csharp
public override int GetHashCode();
```

Returns the hash code for this instance.

**Returns:** A 32-bit signed integer that is the hash code for this instance.

<a id="api-a7ac26d0ea48cb01"></a>

### [`U32 U32.One`](#api-a7ac26d0ea48cb01)


```csharp
public static U32 One { get; }
```

Gets the one constant.

<a id="api-e4285ed18d896651"></a>

### [`string U32.ToString()`](#api-e4285ed18d896651)


```csharp
public override string ToString();
```

Returns the fully qualified type name of this instance.

**Returns:** The fully qualified type name.

<a id="api-0a73fed573b8ae48"></a>

### [`U32 U32.Zero`](#api-0a73fed573b8ae48)


```csharp
public static U32 Zero { get; }
```

Gets the zero constant.

<a id="api-0e5537af17a41e1c"></a>

### [`U32 U32.operator +(U32 left, U32 right)`](#api-0e5537af17a41e1c)


```csharp
public static U32 operator +(U32 left, U32 right);
```

Adds two U32 values.

<a id="api-e77e7b55bee82dd0"></a>

### [`U32 U32.operator &(U32 left, U32 right)`](#api-e77e7b55bee82dd0)


```csharp
public static U32 operator &(U32 left, U32 right);
```

Performs bitwise AND of two U32 values.

<a id="api-bec0d871883a5fb1"></a>

### [`U32 U32.operator |(U32 left, U32 right)`](#api-bec0d871883a5fb1)


```csharp
public static U32 operator |(U32 left, U32 right);
```

Performs bitwise OR of two U32 values.

<a id="api-2fa918ad076fc331"></a>

### [`U32 U32.operator /(U32 left, U32 right)`](#api-2fa918ad076fc331)


```csharp
public static U32 operator /(U32 left, U32 right);
```

Divides two U32 values.

<a id="api-c52c1c79a7df1507"></a>

### [`Bool U32.operator ==(U32 left, U32 right)`](#api-c52c1c79a7df1507)


```csharp
public static Bool operator ==(U32 left, U32 right);
```

Tests equality of two U32 values.

<a id="api-3feefdbec1adde48"></a>

### [`U32 U32.operator ^(U32 left, U32 right)`](#api-3feefdbec1adde48)


```csharp
public static U32 operator ^(U32 left, U32 right);
```

Performs bitwise XOR of two U32 values.

<a id="api-e678ebab9dba939a"></a>

### [`Bool U32.operator >(U32 left, U32 right)`](#api-e678ebab9dba939a)


```csharp
public static Bool operator>(U32 left, U32 right);
```

Tests if left is greater than right.

<a id="api-bb4f6dcb16cb113e"></a>

### [`Bool U32.operator >=(U32 left, U32 right)`](#api-bb4f6dcb16cb113e)


```csharp
public static Bool operator >=(U32 left, U32 right);
```

Tests if left is greater than or equal to right.

<a id="api-8be6e182398036d7"></a>

### [`U32.implicit operator U32(uint value)`](#api-8be6e182398036d7)


```csharp
public static implicit operator U32(uint value);
```

Converts from uint to U32.

<a id="api-a128594b1b979d9f"></a>

### [`U32.implicit operator uint(U32 value)`](#api-a128594b1b979d9f)


```csharp
public static implicit operator uint (U32 value);
```

Converts from U32 to uint.

<a id="api-76f91ccf170c89e4"></a>

### [`Bool U32.operator !=(U32 left, U32 right)`](#api-76f91ccf170c89e4)


```csharp
public static Bool operator !=(U32 left, U32 right);
```

Tests inequality of two U32 values.

<a id="api-2dd502541c95e336"></a>

### [`U32 U32.operator <<(U32 left, int right)`](#api-2dd502541c95e336)


```csharp
public static U32 operator <<(U32 left, int right);
```

Left shifts a U32 value.

<a id="api-4c5900aab22370c8"></a>

### [`Bool U32.operator <(U32 left, U32 right)`](#api-4c5900aab22370c8)


```csharp
public static Bool operator <(U32 left, U32 right);
```

Tests if left is less than right.

<a id="api-cbb72e1be9a93997"></a>

### [`Bool U32.operator <=(U32 left, U32 right)`](#api-cbb72e1be9a93997)


```csharp
public static Bool operator <=(U32 left, U32 right);
```

Tests if left is less than or equal to right.

<a id="api-203d4778c8f7c3c0"></a>

### [`U32 U32.operator *(U32 left, U32 right)`](#api-203d4778c8f7c3c0)


```csharp
public static U32 operator *(U32 left, U32 right);
```

Multiplies two U32 values.

<a id="api-c736570a429e5a48"></a>

### [`U32 U32.operator ~(U32 value)`](#api-c736570a429e5a48)


```csharp
public static U32 operator ~(U32 value);
```

Performs bitwise NOT of a U32 value.

<a id="api-029ec040ba456bc8"></a>

### [`U32 U32.operator >>(U32 left, int right)`](#api-029ec040ba456bc8)


```csharp
public static U32 operator >>(U32 left, int right);
```

Right shifts a U32 value.

<a id="api-db927bae0e3a97ef"></a>

### [`U32 U32.operator -(U32 left, U32 right)`](#api-db927bae0e3a97ef)


```csharp
public static U32 operator -(U32 left, U32 right);
```

Subtracts two U32 values.

