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

#include <vk_render_graph.hh>

Inherits blender::NonCopyable.

Public Member Functions

 VKRenderGraph (std::unique_ptr< VKCommandBufferInterface > command_buffer, VKResourceStateTracker &resources)
NodeHandle next_node_handle ()
Submit graph
void submit_buffer_for_read (VkBuffer vk_buffer)
void submit_for_present (VkImage vk_swapchain_image)
void submit ()
void submit_synchronization_event (VkFence vk_fence)
void wait_synchronization_event (VkFence vk_fence)
Debug
void debug_group_begin (const char *name)
void debug_group_end ()
void debug_print (NodeHandle node_handle) const
Public Member Functions inherited from blender::NonCopyable
 NonCopyable (const NonCopyable &other)=delete
NonCopyableoperator= (const NonCopyable &other)=delete
 NonCopyable ()=default
 NonCopyable (NonCopyable &&other)=default
NonCopyableoperator= (NonCopyable &&other)=default

Public Attributes

VKSubmissionID submission_id

Friends

class VKCommandBuilder
class VKScheduler

Detailed Description

Definition at line 64 of file vk_render_graph.hh.

Constructor & Destructor Documentation

◆ VKRenderGraph()

blender::gpu::render_graph::VKRenderGraph::VKRenderGraph ( std::unique_ptr< VKCommandBufferInterface > command_buffer,
VKResourceStateTracker & resources )

Construct a new render graph instance.

To improve testability the command buffer and resources they work on are provided as a parameter.

Definition at line 13 of file vk_render_graph.cc.

References submission_id.

Member Function Documentation

◆ debug_group_begin()

void blender::gpu::render_graph::VKRenderGraph::debug_group_begin ( const char * name)

Push a new debugging group to the stack with the given name.

New nodes added to the render graph will be associated with this debug group.

Definition at line 105 of file vk_render_graph.cc.

◆ debug_group_end()

void blender::gpu::render_graph::VKRenderGraph::debug_group_end ( )

Pop the top of the debugging group stack.

New nodes added to the render graph will be associated with the parent of the current debug group.

Definition at line 112 of file vk_render_graph.cc.

◆ debug_print()

◆ next_node_handle()

NodeHandle blender::gpu::render_graph::VKRenderGraph::next_node_handle ( )
inline

Utility function that is used during debugging.

When debugging most of the time know the node_handle that is needed after the node has been constructed. When haunting a bug it is more useful to query what the next node handle will be so you can step through the node building process.

Definition at line 259 of file vk_render_graph.hh.

◆ submit()

void blender::gpu::render_graph::VKRenderGraph::submit ( )

Submit full graph.

Definition at line 77 of file vk_render_graph.cc.

References submit_synchronization_event(), and wait_synchronization_event().

◆ submit_buffer_for_read()

void blender::gpu::render_graph::VKRenderGraph::submit_buffer_for_read ( VkBuffer vk_buffer)

Submit partial graph to be able to read the expected result of the rendering commands affecting the given vk_buffer. This method is called from GPU_texture/storagebuf/indexbuf/vertbuf/_read. In vulkan the content of images cannot be read directly and always needs to be copied to a transfer buffer.

After calling this function the mapped memory of the vk_buffer would contain the data of the buffer.

Definition at line 66 of file vk_render_graph.cc.

References lock, and submission_id.

◆ submit_for_present()

void blender::gpu::render_graph::VKRenderGraph::submit_for_present ( VkImage vk_swapchain_image)

Submit partial graph to be able to present the expected result of the rendering commands affecting the given vk_swapchain_image. This method is called when performing a swap chain swap.

Pre conditions:

Post conditions:

  • vk_swapchain_image layout is transitioned to VK_IMAGE_LAYOUT_SRC_PRESENT.

Definition at line 43 of file vk_render_graph.cc.

References lock, submission_id, blender::gpu::render_graph::VKSynchronizationCreateInfo::vk_image, blender::gpu::render_graph::VKSynchronizationCreateInfo::vk_image_aspect, and blender::gpu::render_graph::VKSynchronizationCreateInfo::vk_image_layout.

◆ submit_synchronization_event()

void blender::gpu::render_graph::VKRenderGraph::submit_synchronization_event ( VkFence vk_fence)

Submit render graph with CPU synchronization event.

Definition at line 84 of file vk_render_graph.cc.

References lock, and submission_id.

Referenced by submit().

◆ wait_synchronization_event()

void blender::gpu::render_graph::VKRenderGraph::wait_synchronization_event ( VkFence vk_fence)

Wait and reset for a CPU synchronization event.

Definition at line 94 of file vk_render_graph.cc.

Referenced by submit().

◆ VKCommandBuilder

friend class VKCommandBuilder
friend

Definition at line 65 of file vk_render_graph.hh.

References VKCommandBuilder.

Referenced by VKCommandBuilder, and VKScheduler.

◆ VKScheduler

friend class VKScheduler
friend

Definition at line 66 of file vk_render_graph.hh.

References VKCommandBuilder, and VKScheduler.

Referenced by VKScheduler.

Member Data Documentation

◆ group_names

VectorSet<std::string> blender::gpu::render_graph::VKRenderGraph::group_names

Definition at line 101 of file vk_render_graph.hh.

◆ group_stack

Vector<DebugGroupNameID> blender::gpu::render_graph::VKRenderGraph::group_stack

Current stack of debug group names.

Definition at line 104 of file vk_render_graph.hh.

◆ group_used

bool blender::gpu::render_graph::VKRenderGraph::group_used = false

Has a node been added to the current stack? If not the group stack will be added to used_groups.

Definition at line 107 of file vk_render_graph.hh.

◆ node_group_map

Vector<DebugGroupID> blender::gpu::render_graph::VKRenderGraph::node_group_map

Map of a node_handle to an index of debug group in used_groups.

<source> int used_group_id = node_group_map[node_handle]; const Vector<DebugGroupNameID> &used_group = used_groups[used_group_id]; </source>

Definition at line 118 of file vk_render_graph.hh.

◆ submission_id

VKSubmissionID blender::gpu::render_graph::VKRenderGraph::submission_id

◆ used_groups

Vector<Vector<DebugGroupNameID> > blender::gpu::render_graph::VKRenderGraph::used_groups

All used debug groups.

Definition at line 109 of file vk_render_graph.hh.


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