Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Profile and debug when using variable rate shading

View performance improvements and debug a project that uses variable rate shading.
Read time 1 minuteLast updated 21 days ago

Use the Rendering Debugger or Unity Profiler to monitor GPU frame time and measure performance improvements with variable rate shading. To visualize the shading rate image for render passes that use variable rate shading, use the Frame Debugger.

Use the Rendering Debugger

  1. Open the Rendering Debugger window (menu: Window > Analysis > Rendering Debugger).
  2. Select the Display Stats panel.
    Note
    The Display Stats panel is only visible during Play mode.
  3. In the Frame Stats section, view the GPU frame time metrics.
After implementing variable rate shading, you can observe lower frame time values indicating improved GPU performance.
For more information, refer to the Rendering Debugger window reference for URP.

Use the Unity Profiler

  1. Open the Profiler window (menu: Window > Analysis > Profiler).
  2. In the Profiler window, select the CPU Usage module.
  3. In the Timeline or Hierarchy view for the selected module, look for the
    Gfx.WaitForPresentOnGfxThread
    profiler marker.
A reduction in the
Gfx.WaitForPresentOnGfxThread
marker indicates improved GPU performance.
For more information, refer to Profiler markers.

Use the Frame Debugger

  1. Open the Frame Debugger window (menu: Window > Analysis > Frame Debugger).
  2. Enable the Frame Debugger.
  3. In the events list, select the rendering event from a pass that uses variable rate shading.
  4. In the Event Information panel, expand the Details section.
  5. Locate the Shading Rate Image property for the color visualization of the shading rate image attachment.

Additional resources