文档

Unity Engine


User Manual

Script Reference

Unity Engine


Introduction to PSO tracing and warming

Understand what PSO tracing and warming is, and the project requirements to use the GraphicsStateCollection API.
阅读时间1 分钟最后更新于 24 天前

Understand what PSO tracing and warming is, and the project requirements to use the
GraphicsStateCollection
API.
When Unity uses a shader variant for the first time in your built application, the scene might stutter. This is because Unity and the graphics driver need to compile the shader variant, and create a pipeline state object (PSO) with the compiled shader code and its related GPU state.
To reduce stuttering, compile shaders and create PSOs before they're first needed, so that the graphics driver caches them to disk. This is called warming up, prewarming, or precooking graphics states.

Project requirements

The GraphicsStateCollection API is supported on Unity 6.0 or newer.

Supported graphics APIs

You can use the
GraphicsStateCollection
API on the following graphics APIs:
  • DirectX 12
  • Vulkan
  • Metal
  • WebGPU
  • DirectX 11
  • OpenGL
  • OpenGLES
  • WebGL
注意
On DirectX 11, OpenGL, OpenGLES, or WebGL, the
GraphicsStateCollection
API automatically falls back to shader warm up as outlined in Other methods to warm up shaders.

Shader compatibility

The following shader types aren’t compatible with PSO tracing:
  • Compute shaders
  • Ray tracing shaders

Additional resources