Optimize graphics performance using Frame Advisor render graphs
Introduction
What are render graphs?
Generating a render graph for your application
Understanding your render graph
Problem solving – unused resources
Problem solving – unwanted execution nodes
Problem solving – textures with excessive resolution
Problem solving – inefficient transfer workloads
Next Steps
Optimize graphics performance using Frame Advisor render graphs
Components of a render graph
Here’s the graph from the previous section:
An inefficient render graph in need of optimization
At a basic level, render graphs consist of boxes and arrows:
- Boxes, formally called nodes, represent rendering operations and resources. Nodes for rendering operations are formally called execution nodes.
- Arrows, formally called edges, show the movement of data between rendering operations.
Render graphs describe rendering performed by the GPU while it is constructing a single frame. This rendering starts and ends with resources. As a result of graphs being read from left to right:
- The leftmost nodes represent the rendering of input resources, such as one or more textures.
- The rightmost nodes represent the final outputs of the rendering.
To keep the graph as simple as possible, Frame Advisor omits read-only resources.
In an efficiently-generated frame, all workloads and generated resources contribute to the creation of the final swapchain output image shown on the right of the diagram. Notice in the graph above that the swapchain is shown in a different color.
In a suboptimally-generated frame, there may be other outputs which are not sent to the swapchain and consequently are not shown to a user. These represent unwanted data movement.
Graph nodes in detail
Take a closer look at what can be represented in a node on the render graph.
Render passes
Most of the execution nodes in the sample graph above are colored green and labeled “RP…” These are render passes .
Figure 2. A render pass node
Render passes transform sets of input images into sets of output images using a rendering pipeline. The way this is declared varies across APIs. In OpenGL ES, a number of different API calls can indicate the boundaries of a render pass. In Vulkan, render passes are declared explicitly .
Within each execution node representing a render pass, Frame Advisor gives information such as:
- The resolution of the texture being rendered
- A list of the attachments provided to the render pass and the name of each of these attachments.
- The number of API draw calls within the render pass.
When you click an execution node, such as a render pass, Frame Advisor navigates to the associated API call.
Other types of execution node
The graph also shows a transfer node, colored blue, and labeled ”Tr…”.
A transfer node
Transfer nodes represent data movement between resource locations in memory.
You may also see other types of execution node. For example, you may see compute nodes if your application uses compute shaders.
Resource nodes
Resource nodes show inputs and outputs of the execution nodes. They are shown as small grey rectangles with rounded edges.
There are different types of resource node:
- The swapchain: this represents the output of the computation. There is one swapchain on every graph.
A swapchain node - Textures
: these are marked with a leading letter
T.
A node for texture 1 - Render buffers
: Like textures, these represent images. The title of render buffer nodes begins with letters
RB. The title ends with a code indicating the class of render buffer – for example,.sfor stencil and.dfor depth.
A node for render buffer 1, representing depth
The original render graph also contains a render buffer node representing a stencil.