Version: Unity 7.0 Alpha (7000.0)
Language : English
Make a GameObject compatible with the GPU Resident Drawer in URP
GPU Resident Drawer performance considerations

Analyze the GPU Resident Drawer in URP

The GPU Resident Drawer (GRD) draws only the renderers that are compatible with it. When a renderer isn’t compatible, Unity draws it with the Scriptable Render Pipeline (SRP) Batcher or the standard rendering path instead. Excluded renderers can increase the number of draw calls Unity issues, which reduces the performance benefit of the GPU Resident Drawer.

Use the following tools to analyze the GPU Resident Drawer:

Prerequisites

Enable the GPU Resident Drawer in your URP project.

Measure coverage in the Profiler

The Rendering Profiler module reports how many renderers the GPU Resident Drawer draws each frame, why it excludes renderers, and how much CPU time it uses.

To measure GPU Resident Drawer coverage for a frame, do the following:

  1. Go to Window > Analysis > Profiler.

  2. In the module list, select Rendering.

  3. Select Record, then run your project.

  4. Select a frame in the chart.

  5. In the details pane, go to the GPU Resident Drawer area.

    The GPU Resident Drawer area appears only if the GPU Resident Drawer ran during the frame you select, and each section inside it appears only if Unity captured data for it.

  6. Read the GRD coverage bar, which splits the renderers into GRD and Excluded, followed by the coverage percentage.

  7. To break the Excluded total down by cause, expand the GRD coverage row.

Each reason displays the number of renderers it affects, and a tooltip that explains how to make those renderers compatible. For the full list of reasons and solutions, refer to GPU Resident Drawer exclusion reasons reference.

To find which draw calls a reason affects, note the reason, then open the Frame Debugger. Refer to Find excluded renderers in the Frame Debugger.

For more information on the other statistics in this area, such as the culling, level of detail (LOD), and pipeline timing breakdowns, refer to Rendering Profiler module reference.

View GPU Resident Drawer counters over time

By default, the chart in the Rendering Profiler module plots the batch, SetPass call, triangle, and vertex counts. Select a GPU Resident Drawer chart mode to find the frame where a value changes, for example to watch coverage increase while a scene streams in.

To view GPU Resident Drawer counters over time, do the following:

  1. In the Rendering Profiler module toolbar, open the chart mode dropdown.
  2. Select a chart mode, such as GRD Coverage.

The frame range stays the same when you change the chart mode, so you don’t lose your position in the recording.

For more information on the counters in each chart mode, refer to Rendering Profiler module reference.

Find excluded renderers in the Frame Debugger

The Frame Debugger reports exclusions per draw call, so use it to find which draw calls contain the excluded renderers.

To find the draw calls that contain excluded renderers, do the following:

  1. Go to Window > Analysis > Frame Debugger.
  2. Select Enable to capture a frame.
  3. In the event hierarchy, select an SRP Batch or standard draw call event.
  4. In the Event Information panel, read the GRD Exclusion Cause property.

GRD Exclusion Cause lists each reason that applies to the renderers in the selected draw call. If two or more renderers share a reason, the reason displays the number of renderers. To find out what a reason means and how to resolve it, refer to GPU Resident Drawer exclusion reasons reference.

Color renderers by batching path

The Batching Type debug view colors each renderer according to its rendering path, so you can identify excluded renderers visually instead of using counters. The Batching Type property appears only in the Unity Editor, and only if you enable the GPU Resident Drawer in the URP asset.

To color renderers by batching path, do the following:

  1. Go to Window > Analysis > Rendering Debugger.
  2. Select the Rendering panel.
  3. In the Rendering Debug section, enable Batching Type.

Unity uses the following colors:

  • Green: The GPU Resident Drawer.
  • Blue: The SRP Batcher.
  • Orange: No batching.
  • Grey: The GPU Resident Drawer doesn’t track the renderer. Transparent objects also appear grey, even when the GPU Resident Drawer draws them.

Unity predicts the blue and orange colors from the exclusion reason, not from the draw call. To check how Unity actually batches a renderer, and why a renderer isn’t green, select its draw call in the Frame Debugger. Refer to Find excluded renderers in the Frame Debugger.

Check batching as you edit a scene

The Rendering Statistics window reports how many distinct materials and meshes the batches use, and how many batches draw only one object. Use these values to check how a change affects batching in real time.

To check batching for the current frame, do the following:

  1. In the Game view, select Stats.
  2. Expand the GPU Resident Drawer foldout.
  3. Edit your scene and monitor the changing values.

Unity draws objects that share a mesh and material together in one instanced draw call. A high Unique Materials or Unique Meshes value means fewer objects share them, so merge materials and meshes to reduce it. Single-Instance Batches counts the batches that draw only one object and save no draw calls, so share mesh and material combinations between more GameObjects to reduce it.

The GPU Resident Drawer foldout appears only while the GPU Resident Drawer is running. For more information on each statistic, refer to Rendering Statistics window reference.

To view the same values over time, use the GRD Batches chart mode in the Rendering Profiler module. Refer to View GPU Resident Drawer counters over time.

Additional resources

Make a GameObject compatible with the GPU Resident Drawer in URP
GPU Resident Drawer performance considerations