notes/vulkan-and-computer-graphic/framegraph

Features

Implementation Consideration

Data-driven approach

  1. Define our graph in JSON, implement parser.
    • Have inputs, outputs, name for each node.
    • Resource types: texture, attachment, buffer, reference...
  2. steps to use framegraph:
    1. parse JSON
    2. compile()
    3. register_render_graph()
    4. render() And this is possible to switch framegraph at runtime.
  3. In compile() step of framegraph, we need:
    1. topological sort the nodes to decide rendering order.
    2. computing the resource aliasing for better memory reuse by checking the lifetime of resource.

Rendering stage (Preparing draw commands)

  1. We first iterate through all the inputs of a node. If the resource is a texture, we insert a barrier to transition that resource from an attachment layout (for use in a render pass) to a shader stage layout (for use in a fragment shader).

Implementation Details

Parsing graph