Warm up shaders if your build targets the DirectX 11, OpenGL, OpenGLES, or WebGL graphics APIs.
If your project uses the DirectX 11, OpenGL, OpenGLES, or WebGL graphics APIs, Unity provides multiple methods to warm up shaders in your project.
On DirectX 11, OpenGL, OpenGLES, or WebGL graphics APIs, you can also use the following methods to warm up shaders:
To warm up a shader variant collection, do any of the following:
ShaderVariantCollection.WarmUp to warm up the shader variants when your built application starts.Note: These methods aren’t recommended on Vulkan, DirectX 12, and Metal because they can create the wrong PSOs due to missing graphics states.