You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Efficient resource management: Accurately track when and where each resource is created, used, and destroyed. Automatic resource lifecycle management.
Easy to debug: Based on DAG, it is very convenient to visualize the rendering graph, which is used to analyze the dependencies and execution order between rendering stages, as well as node status, performance analysis, statistics, etc.
User-facing explanation
The frame graph is DAG. It consists of pass nodes and resource nodes. The render node describes how to draw the resource to the GPU. The resource node describes how to use the resource.
The frame graph divides the rendering of a frame into three stages: Setup, Compile, and Execute. In the Setup stage, the user can freely build the frame graph. In the Compile stage, the frame graph will confirm the life cycle of each resource. In the Execute stage, the frame graph will match the resources with the GPU resources one by one and execute the rendering described by the pass node.
Resource
One of the most important feature of the frame graph is to automatically manage the creation, use, and destruction of resources. The resources here are not GPU resources. They are frame graph-defined resources. Resources usually do not correspond to actual GPU resources. Only in the Execute Stage of the frame graph will they correspond to GPU resources one-to-one. Therefore, resources usually have two states: resource descriptor and resource instance. The definition in rust is as follows:
Two types of resources are defined here: buffer and texture. If necessary, you can easily expand AnyFrameGraphResourceDescriptor, AnyFrameGraphResource.
How to build a render pass
In Bevy's current design, GPU resources are directly obtained for rendering.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
Frame graph based renderer design.
Motivation
Frame graph will add two features:
User-facing explanation
The frame graph is DAG. It consists of pass nodes and resource nodes. The render node describes how to draw the resource to the GPU. The resource node describes how to use the resource.
The frame graph divides the rendering of a frame into three stages: Setup, Compile, and Execute. In the Setup stage, the user can freely build the frame graph. In the Compile stage, the frame graph will confirm the life cycle of each resource. In the Execute stage, the frame graph will match the resources with the GPU resources one by one and execute the rendering described by the pass node.
Resource
One of the most important feature of the frame graph is to automatically manage the creation, use, and destruction of resources. The resources here are not GPU resources. They are frame graph-defined resources. Resources usually do not correspond to actual GPU resources. Only in the Execute Stage of the frame graph will they correspond to GPU resources one-to-one. Therefore, resources usually have two states: resource descriptor and resource instance. The definition in rust is as follows:
Two types of resources are defined here: buffer and texture. If necessary, you can easily expand AnyFrameGraphResourceDescriptor, AnyFrameGraphResource.
How to build a render pass
In Bevy's current design, GPU resources are directly obtained for rendering.
In the new design, rendering is done through a layer of encapsulation, and all resources are obtained from render_context.
In this design there is no need to know when the relationship resources are created.
How to build pass
Beta Was this translation helpful? Give feedback.
All reactions