Version: Unity 6 (6000.0)
Language : English
Enable or disable asynchronous shader compilation
Troubleshooting asynchronous shader compilation

Detect asynchronous shader compilation

You can use C# APIs to monitor the state of asynchronous shaderA program that runs on the GPU. More info
See in Glossary
compilation, and perform operations when this state changes.

This is most likely useful in advanced rendering; if the placeholder shader pollutes your generated data, you can wait until compilation is complete, discard the polluted data, and regenerate a new set with the correct shader variants.

If you already know which material you are interested in, you can use ShaderUtil.IsPassCompiled to check the compilation status of the shader variant. When the status changes Uncompiled to Compiled, compilation is complete.

If you do not know which material you are interested in, or if you are interested in more than one material, you can use ShaderUtil.anythingCompiling to detect whether Unity is compiling any shader variants asynchronously. When this changes from true to false, all current compilation is complete.

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