Find inefficient geometry

Use the Content Metrics view in Frame Advisor to find geometry-related problems with the objects in the scene. This view shows a range of useful metrics, broken down by frame, render pass, and draw call.

To find geometry-related problems using the view, follow these steps:

  1. In the Content Metrics view, select Draws and sort the table by the highest number of primitives (Prims) to find the most complex objects.

    Image Alt Text:Content Metrics sorted by descending primitive countSorting Content Metrics view by primitives

  2. Right-click the draw call at the top of the list and choose Navigate to call. The complex object is now selected in the Frame Hierarchy view and visible in the Framebuffers view.

    The object in the example is the Sphinx model, built using almost 23,000 primitives. This is a high number for a game object on mobile. If you encounter a high number, first determine whether the model can be simplified. Fewer primitives reduce GPU processing cost and memory bandwidth.

    Image Alt Text:Selected Sphinx draw call shown in the Frame hierarchy and Framebuffers viewsThe Sphinx model shown in the Framebuffers view

    In cases where the model can’t be simplified any further, there are other options to consider.

  3. Look at the Detailed Metrics view. The view shows a range of metrics about the mesh. The example Sphinx mesh uses almost 46,000 indices, and each index is used by two primitives, showing some index reuse.

    However, almost 32,000 of the vertices are duplicates, which means they have identical data to another vertex in the model. It’s worth removing the duplicate vertices, which would give a significant reduction in processing cost and memory bandwidth.

    Image Alt Text:Detailed Metrics showing duplicate vertices for the selected Sphinx meshThe Detailed Metrics view in Frame Advisor

Tip

To see full descriptions of all the metrics in the Detailed Metrics view, use the information button.

  1. Next, sort the Content Metrics table by lowest vertex shading efficiency (VSE). This identifies objects that shade more indices than they use. Gaps in the index stream can cause unused indices to be shaded. Poor reuse locality can cause indices to be shaded multiple times.

    Image Alt Text:Content Metrics showing the selected draw call with a VSE of 0.08Content Metrics sorted by VSE

    VSE values range from 0 to 1. A VSE of 1 indicates optimal shading, with one shader invocation per useful input vertex. An efficiency of 0.5 indicates that there are two shader invocations per useful input vertex.

    The object with the lowest VSE in the example is the snake head statue model. There are five instances of this model in the scene, although only three are partially visible in this frame.

    Image Alt Text:Framebuffers view highlighting three partially visible snake headsThe snake head statues shown in the Framebuffers view

    For this model, the Detailed Metrics view shows that over 5000 indices are used to create almost 10,000 primitives, which is reasonable. However, over 64,000 vertices are being shaded. This is far higher than the index count, which means that some vertices are being shaded multiple times. This is wasteful.

    Image Alt Text:Detailed Metrics showing temporal and spatial locality for the selected snake head meshDetailed metrics for the snake head statues

    The report also shows that the temporal and spatial locality figures for the example are very high.

    Temporal locality shows that, on average, there are over 4000 indices between reuse of an index value. This number of indices is much larger than the post-transform cache on many mainstream Arm GPUs, which can store 1024 indices. This means that vertices are likely to be evicted from the cache before an index is reused, resulting in reshading.

    Ideally, index temporal locality should be under 500 to maximize the chance of post-transform cache hits. To reduce temporal locality, try reordering the data to move reuses closer together in the index buffer.

    Spatial locality shows that, on average, there are around 1300 indices between neighbouring indices. This means that data for a single primitive is likely to be far apart in memory, which can reduce the effectiveness of the shader core data caches during vertex shading.

    Spatial locality should be kept as low as possible, ensuring that vertices within neighbouring primitives are using data that is the same set of cache lines and memory pages. To reduce spatial locality, try reordering the data to move neighbours closer together in the source data buffer.

What you’ve accomplished

You’ve used the Content Metrics view in Frame Advisor to identify inefficient geometry in the captured frame.

You’ve learned how to use Frame Advisor to analyze a captured frame. You can use these steps to capture and analyze more frames from your applications.

Back
Next