buffer | 要执行的 CommandBuffer。 |
queueType | 描述要执行的提供的 CommandBuffer 的所需异步计算队列类型。 |
在异步计算队列上执行命令缓冲区,队列的选择基于传递的 ComputeQueueType 参数。
要求命令缓冲区中的所有命令都适合在异步计算队列上执行。如果缓冲区包含任何不合适的命令,则会记录错误并显示在编辑器窗口中。具体来说,在旨在进行异步执行的 CommandBuffer 中允许以下命令
CommandBuffer.BeginSample
CommandBuffer.BuildRayTracingAccelerationStructure
CommandBuffer.CopyCounterValue
CommandBuffer.CopyTexture
CommandBuffer.CreateGraphicsFence
CommandBuffer.DisableShaderKeyword
CommandBuffer.DispatchCompute
CommandBuffer.EnableShaderKeyword
CommandBuffer.EndSample
CommandBuffer.GetTemporaryRT
CommandBuffer.GetTemporaryRTArray
CommandBuffer.IssuePluginEvent
CommandBuffer.ReleaseTemporaryRT
CommandBuffer.SetComputeBufferData
CommandBuffer.SetComputeBufferParam
CommandBuffer.SetComputeFloatParam
CommandBuffer.SetComputeFloatParams
CommandBuffer.SetComputeIntParam
CommandBuffer.SetComputeIntParams
CommandBuffer.SetComputeMatrixArrayParam
CommandBuffer.SetComputeMatrixParam
CommandBuffer.SetComputeTextureParam
CommandBuffer.SetComputeVectorParam
CommandBuffer.SetComputeVectorArrayParam
CommandBuffer.SetGlobalBuffer
CommandBuffer.SetGlobalColor
CommandBuffer.SetGlobalFloat
CommandBuffer.SetGlobalFloatArray
CommandBuffer.SetGlobalInt
CommandBuffer.SetGlobalMatrix
CommandBuffer.SetGlobalMatrixArray
CommandBuffer.SetGlobalTexture
CommandBuffer.SetGlobalVector
CommandBuffer.SetGlobalVectorArray
CommandBuffer.WaitOnGraphicsFence
保证缓冲区中的所有命令都在同一个队列上执行。如果目标平台不支持异步计算队列,则会在图形队列上调度工作。
其他资源:SystemInfo.supportsAsyncCompute , GPUFence, CommandBuffer.