Version: 2020.1

ShaderUtil.SetAsyncCompilation

切换到手册
public static void SetAsyncCompilation (Rendering.CommandBuffer cmd, bool allow);

参数

cmd 目标 CommandBuffer。
allow 是否允许异步着色器编译。

描述

在 CommandBuffer 中添加着色器编译模式命令。

编辑器会按需编译着色器变体,首次渲染需要特定着色器变体。默认情况下,仅为源自 Game 视图或 Scene 视图的请求启用异步着色器编译。借助此方法,可以向 CommandBuffer 添加在缓冲区执行过程中控制着色器编译的命令。这样可以对 Game 视图、Scene 视图和其他视图,在渲染的特定部分(例如自定义工具)上禁用和启用异步编译。 若要恢复以前的编译模式,请参阅 RestoreAsyncCompilation

另请参阅:RestoreAsyncCompilationallowAsyncCompilationanythingCompilingIsPassCompiledCompilePass

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