Version: 2022.3
LanguageEnglish
  • C#

CommandBuffer.WaitOnAsyncGraphicsFence

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void WaitOnAsyncGraphicsFence(Rendering.GraphicsFence fence);

Declaration

public void WaitOnAsyncGraphicsFence(Rendering.GraphicsFence fence, Rendering.SynchronisationStage stage);

Declaration

public void WaitOnAsyncGraphicsFence(Rendering.GraphicsFence fence, Rendering.SynchronisationStageFlags stage);

Parameters

fence The GraphicsFence the GPU waits for. The fenceType of the graphics fence must be GraphicsFenceType.AsyncQueueSynchronisation.
stage Which SynchronisationStage to wait for.

Description

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

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 to check if a platform supports fences.

It's possible to create circular dependencies with this function that deadlock the GPU. See GraphicsFence for more information.

Additional resources: GraphicsFence, CommandBuffer.CreateGraphicsFence.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961