Version: 2017.3 (switch to 2017.4)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

CommandBuffer.CreateGPUFence

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

public method CreateGPUFence(stage: Rendering.SynchronisationStage = SynchronisationStage.PixelProcessing): Rendering.GPUFence;
public Rendering.GPUFence CreateGPUFence(Rendering.SynchronisationStage stage = SynchronisationStage.PixelProcessing);

Parameters

stage On some platforms there is a significant gap between the vertex processing completing and the pixel processing begining for a given draw call. This parameter allows for the fence to be passed after either the vertex or pixel processing for the proceeding draw has completed. If a compute shader dispatch was the last task submitted then this parameter is ignored.

Returns

GPUFence Returns a new GPUFence.

Description

Creates a GPUFence which will be passed after the last Blit, Clear, Draw, Dispatch or Texture Copy command prior to this call has been completed on the GPU.

This includes those from this CommandBuffer or from another CommandBuffer that has been executed immediately prior to the creation of the fence.

Some platforms cannot differentiate between the completion of vertex and pixel processing, on these platforms the fence is passed after the pixel processing has completed regardless of the value passed to the stage parameter.

This function can still be called on platforms that do not support GPUFences though the resulting fence will have no function and will do nothing if waited on (see Graphics.WaitOnGPUFence and CommandBuffer.WaitOnGPUFence).

See Also:GPUFence, Graphics.WaitOnGPUFence, CommandBuffer.WaitOnGPUFence, SystemInfo.supportsGPUFence.

对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答