# WaitOnAsyncGraphicsFence

> Instructs the GPU to pause processing of the queue until it passes through the GraphicsFence fence.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Rendering](/engine/6000.0/script-reference/unityengine/rendering.md)
* **Assembly:** UnityEngine.CoreModule

## WaitOnAsyncGraphicsFence(GraphicsFence)

Instructs the GPU to pause processing of the queue until it passes through the [GraphicsFence](/engine/6000.0/script-reference/unityengine/rendering/graphicsfence.md) fence.

```csharp
public void WaitOnAsyncGraphicsFence(GraphicsFence fence)
```

### Parameters

**** (\[GraphicsFence]\(/engine/6000.0/script-reference/unityengine/rendering/graphicsfence)): The [GraphicsFence](/engine/6000.0/script-reference/unityengine/rendering/graphicsfence.md) the GPU waits for. The `fenceType` of the graphics fence must be [GraphicsFenceType.AsyncQueueSynchronisation](/engine/6000.0/script-reference/unityengine/rendering/graphicsfencetype/asyncqueuesynchronisation.md).

### Remarks

This method returns immediately on the CPU. Only GPU processing is affected by the graphics fence.

You can use the `stage` parameter to wait until the start of the next item's vertex or pixel processing. On some platforms, there's a gap between the end of vertex processing and the start of pixel processing in a draw call. If the last command was a compute shader dispatch, Unity ignores `stage`.

This method only works on platforms that support fences. Use [SystemInfo.supportsGraphicsFence](/engine/6000.0/script-reference/unityengine/systeminfo/supportsgraphicsfence.md) to check if a platform supports fences.

It's possible to create circular dependencies with this function that deadlock the GPU. See [GraphicsFence](/engine/6000.0/script-reference/unityengine/rendering/graphicsfence.md) for more information.

Additional Resources: [GraphicsFence](/engine/6000.0/script-reference/unityengine/rendering/graphicsfence.md), [CommandBuffer.CreateGraphicsFence](/engine/6000.0/script-reference/unityengine/rendering/commandbuffer/creategraphicsfence.md).

## WaitOnAsyncGraphicsFence(GraphicsFence, SynchronisationStage)

Instructs the GPU to pause processing of the queue until it passes through the [GraphicsFence](/engine/6000.0/script-reference/unityengine/rendering/graphicsfence.md) fence.

```csharp
public void WaitOnAsyncGraphicsFence(GraphicsFence fence, SynchronisationStage stage)
```

### Parameters

**** (\[GraphicsFence]\(/engine/6000.0/script-reference/unityengine/rendering/graphicsfence)): The [GraphicsFence](/engine/6000.0/script-reference/unityengine/rendering/graphicsfence.md) the GPU waits for. The `fenceType` of the graphics fence must be [GraphicsFenceType.AsyncQueueSynchronisation](/engine/6000.0/script-reference/unityengine/rendering/graphicsfencetype/asyncqueuesynchronisation.md).**** (\[SynchronisationStage]\(/engine/6000.0/script-reference/unityengine/rendering/synchronisationstage)): Which [SynchronisationStage](/engine/6000.0/script-reference/unityengine/rendering/synchronisationstage.md) to wait for.

### Remarks

This method returns immediately on the CPU. Only GPU processing is affected by the graphics fence.

You can use the `stage` parameter to wait until the start of the next item's vertex or pixel processing. On some platforms, there's a gap between the end of vertex processing and the start of pixel processing in a draw call. If the last command was a compute shader dispatch, Unity ignores `stage`.

This method only works on platforms that support fences. Use [SystemInfo.supportsGraphicsFence](/engine/6000.0/script-reference/unityengine/systeminfo/supportsgraphicsfence.md) to check if a platform supports fences.

It's possible to create circular dependencies with this function that deadlock the GPU. See [GraphicsFence](/engine/6000.0/script-reference/unityengine/rendering/graphicsfence.md) for more information.

Additional Resources: [GraphicsFence](/engine/6000.0/script-reference/unityengine/rendering/graphicsfence.md), [CommandBuffer.CreateGraphicsFence](/engine/6000.0/script-reference/unityengine/rendering/commandbuffer/creategraphicsfence.md).

## WaitOnAsyncGraphicsFence(GraphicsFence, SynchronisationStageFlags)

Instructs the GPU to pause processing of the queue until it passes through the [GraphicsFence](/engine/6000.0/script-reference/unityengine/rendering/graphicsfence.md) fence.

```csharp
public void WaitOnAsyncGraphicsFence(GraphicsFence fence, SynchronisationStageFlags stage)
```

### Parameters

**** (\[GraphicsFence]\(/engine/6000.0/script-reference/unityengine/rendering/graphicsfence)): The [GraphicsFence](/engine/6000.0/script-reference/unityengine/rendering/graphicsfence.md) the GPU waits for. The `fenceType` of the graphics fence must be [GraphicsFenceType.AsyncQueueSynchronisation](/engine/6000.0/script-reference/unityengine/rendering/graphicsfencetype/asyncqueuesynchronisation.md).**** (\[SynchronisationStageFlags]\(/engine/6000.0/script-reference/unityengine/rendering/synchronisationstageflags)): Which [SynchronisationStage](/engine/6000.0/script-reference/unityengine/rendering/synchronisationstage.md) to wait for.

### Remarks

This method returns immediately on the CPU. Only GPU processing is affected by the graphics fence.

You can use the `stage` parameter to wait until the start of the next item's vertex or pixel processing. On some platforms, there's a gap between the end of vertex processing and the start of pixel processing in a draw call. If the last command was a compute shader dispatch, Unity ignores `stage`.

This method only works on platforms that support fences. Use [SystemInfo.supportsGraphicsFence](/engine/6000.0/script-reference/unityengine/systeminfo/supportsgraphicsfence.md) to check if a platform supports fences.

It's possible to create circular dependencies with this function that deadlock the GPU. See [GraphicsFence](/engine/6000.0/script-reference/unityengine/rendering/graphicsfence.md) for more information.

Additional Resources: [GraphicsFence](/engine/6000.0/script-reference/unityengine/rendering/graphicsfence.md), [CommandBuffer.CreateGraphicsFence](/engine/6000.0/script-reference/unityengine/rendering/commandbuffer/creategraphicsfence.md).
