# Xui.GPU.Shaders

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

## Types

- [`struct FragmentOutput`](#api-9773b84791f72f60)
- [`interface IFragmentShader<TInput, TOutput, TBindings>`](#api-1426b44719e7c12b)
- [`interface IShaderStage`](#api-711951042c397ce2)
- [`interface IVertexShader<TInput, TOutput, TBindings>`](#api-d04c22aadcc35597)

<a id="api-9773b84791f72f60"></a>

## `struct FragmentOutput`

Standard fragment shader output structure.

```csharp
public struct FragmentOutput
{
    public Color4 Color;
}
```

<a id="api-00a357c5b02089ad"></a>

### [`Color4 FragmentOutput.Color`](#api-00a357c5b02089ad)


```csharp
public Color4 Color;
```

The output color value.


<a id="api-1426b44719e7c12b"></a>

## `interface IFragmentShader<TInput, TOutput, TBindings>`

Fragment shader interface that computes pixel colors.

- **`TInput`** — The fragment input/varyings structure type.

- **`TOutput`** — The fragment output structure type.

- **`TBindings`** — The shader resource bindings type.

```csharp
public interface IFragmentShader<TInput, TOutput, TBindings> : IShaderStage where TInput : unmanaged where TOutput : unmanaged where TBindings : struct
{
    TOutput Execute(TInput input, in TBindings bindings);
}
```

<a id="api-b7f40db86d1c5cb9"></a>

### [`TOutput IFragmentShader<TInput, TOutput, TBindings>.Execute(TInput input, in TBindings bindings)`](#api-b7f40db86d1c5cb9)


```csharp
TOutput Execute(TInput input, in TBindings bindings);
```

Executes the fragment shader for a single fragment.

- **`input`** — The interpolated fragment input data.

- **`bindings`** — The shader resource bindings.

**Returns:** The computed fragment output.


<a id="api-711951042c397ce2"></a>

## `interface IShaderStage`

Base interface for all shader stages. Shader stages are the execution points in the rendering pipeline.

```csharp
public interface IShaderStage
{
}
```


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

## `interface IVertexShader<TInput, TOutput, TBindings>`

Vertex shader interface that transforms vertex input data.

- **`TInput`** — The vertex input structure type.

- **`TOutput`** — The vertex output/varyings structure type.

- **`TBindings`** — The shader resource bindings type.

```csharp
public interface IVertexShader<TInput, TOutput, TBindings> : IShaderStage where TInput : unmanaged where TOutput : unmanaged where TBindings : struct
{
    TOutput Execute(TInput input, in TBindings bindings);
}
```

<a id="api-16d51eefcec7a00c"></a>

### [`TOutput IVertexShader<TInput, TOutput, TBindings>.Execute(TInput input, in TBindings bindings)`](#api-16d51eefcec7a00c)


```csharp
TOutput Execute(TInput input, in TBindings bindings);
```

Executes the vertex shader for a single vertex.

- **`input`** — The vertex input data.

- **`bindings`** — The shader resource bindings.

**Returns:** The transformed vertex output.

