# Sandbox.Rendering.CommandList.ResourceBarrierTransition

## Overload 1

```csharp
void ResourceBarrierTransition(Texture texture, ResourceState state, int mip = -1)
```

Executes a barrier transition for the given GPU Texture Resource.
Transitions the texture resource to a new pipeline stage and access state.

### Parameters

- `texture` (`Texture`): The texture to transition.
- `state` (`ResourceState`): The new resource state for the texture.
- `mip` (`int`), default `-1`: The mip level to transition (-1 for all mips).

## Overload 2

```csharp
void ResourceBarrierTransition(ColorTextureRef texture, ResourceState state, int mip = -1)
```

Executes a barrier transition for the color texture of the given render target handle.

### Parameters

- `texture` (`ColorTextureRef`): The render target color handle.
- `state` (`ResourceState`): The new resource state for the texture.
- `mip` (`int`), default `-1`: The mip level to transition (-1 for all mips).

## Overload 3

```csharp
void ResourceBarrierTransition(DepthTextureRef texture, ResourceState state, int mip = -1)
```

Executes a barrier transition for the depth texture of the given render target handle.

### Parameters

- `texture` (`DepthTextureRef`): The render target depth handle.
- `state` (`ResourceState`): The new resource state for the texture.
- `mip` (`int`), default `-1`: The mip level to transition (-1 for all mips).

## Overload 4

```csharp
void ResourceBarrierTransition(RenderTargetHandle handle, ResourceState state, int mip = -1)
```

Executes a barrier transition for the color texture of the given render target handle.

### Parameters

- `handle` (`RenderTargetHandle`): The render target handle.
- `state` (`ResourceState`): The new resource state for the texture.
- `mip` (`int`), default `-1`: The mip level to transition (-1 for all mips).

## Overload 5

```csharp
void ResourceBarrierTransition(GpuBuffer buffer, ResourceState state)
```

Executes a barrier transition for the given GPU Buffer Resource.
Transitions the buffer resource to a new pipeline stage and access state.

### Parameters

- `buffer` (`GpuBuffer`): The GPU buffer to transition.
- `state` (`ResourceState`): The new resource state for the buffer.

## Overload 6

```csharp
void ResourceBarrierTransition(GpuBuffer buffer, ResourceState before, ResourceState after)
```

Executes a barrier transition for the given GPU Buffer Resource.
Transitions the buffer resource from a known source state to a specified destination state.

### Parameters

- `buffer` (`GpuBuffer`): The GPU buffer to transition.
- `before` (`ResourceState`): The current resource state of the buffer.
- `after` (`ResourceState`): The desired resource state of the buffer after the transition.

Declared in [Sandbox.Rendering.CommandList](/api/Sandbox.Rendering.CommandList).
Assembly: `Sandbox.Engine`.
