Blender V4.3
blender::gpu::render_graph::VKScheduler Class Reference

#include <vk_scheduler.hh>

Public Member Functions

Span< NodeHandleselect_nodes_for_image (const VKRenderGraph &render_graph, VkImage vk_image)
 
Span< NodeHandleselect_nodes_for_buffer (const VKRenderGraph &render_graph, VkBuffer vk_buffer)
 
Span< NodeHandleselect_nodes (const VKRenderGraph &render_graph)
 

Detailed Description

VKScheduler is responsible for selecting and reordering of nodes in the render graph. This selection and order is used to convert the nodes to commands and submitting it to the GPU.

This scheduler selects all nodes in the order they were added to the render graph.

This is an initial implementation and should be enhanced for:

  • Moving data transfer and compute before drawing, when they are scheduled between drawing nodes that use the same pipeline.
  • Only select the nodes that are only needed for the given vk_image/vk_buffer. When performing read-backs of buffers should be done with as least as possible nodes as they can block drawing. It is better to do handle most nodes just before presenting the image. This would lead to less CPU locks.
  • Pruning branches that are not linked to anything. EEVEE can add debug commands that would eventually not been displayed on screen. These branches should be pruned. The challenge is that we need to know for certain that it isn't used in a not submitted part of the graph.

TODO: Walking the render graph isn't implemented yet. The idea is to have a Map<ResourceWithStamp, Vector<NodeHandle>> consumers and Map<ResourceWithStamp, NodeHandle> producers. These attributes can be stored in the render graph and created when building the links, or can be created inside the VKScheduler as a variable. The exact detail which one would be better is unclear as there aren't any users yet. At the moment the scheduler would need them we need to figure out the best way to store and retrieve the consumers/producers.

Definition at line 46 of file vk_scheduler.hh.

Member Function Documentation

◆ select_nodes()

Span< NodeHandle > blender::gpu::render_graph::VKScheduler::select_nodes ( const VKRenderGraph & render_graph)
nodiscard

◆ select_nodes_for_buffer()

Span< NodeHandle > blender::gpu::render_graph::VKScheduler::select_nodes_for_buffer ( const VKRenderGraph & render_graph,
VkBuffer vk_buffer )
nodiscard

Determine which nodes of the render graph should be selected and in what order they should be executed to update the given vk_buffer to its latest content and state.

NOTE: Currently will select all nodes. NOTE: Result becomes invalid by the next call to VKScheduler.

Definition at line 28 of file vk_scheduler.cc.

References UNUSED_VARS.

Referenced by blender::gpu::render_graph::VKRenderGraph::submit_buffer_for_read().

◆ select_nodes_for_image()

Span< NodeHandle > blender::gpu::render_graph::VKScheduler::select_nodes_for_image ( const VKRenderGraph & render_graph,
VkImage vk_image )
nodiscard

Determine which nodes of the render graph should be selected and in what order they should be executed to update the given vk_image to its latest content and state.

NOTE: Currently will select all nodes. NOTE: Result becomes invalid by the next call to VKScheduler.

Definition at line 19 of file vk_scheduler.cc.

References UNUSED_VARS.

Referenced by blender::gpu::render_graph::VKRenderGraph::submit_for_present().


The documentation for this class was generated from the following files: