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.

Referenced by blender::gpu::VKContext::debug_group_begin().

◆ 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.

Referenced by blender::gpu::VKContext::debug_group_end().

◆ debug_print()

void blender::gpu::render_graph::VKRenderGraph::debug_print ( NodeHandle node_handle) const

◆ 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.

References blender::Vector< T, InlineBufferCapacity, Allocator >::size().

◆ submit()

◆ 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 blender::gpu::render_graph::VKCommandBuilder::build_nodes(), lock, blender::gpu::render_graph::VKResourceStateTracker::mutex, blender::gpu::render_graph::VKScheduler::select_nodes_for_buffer(), and submission_id.

Referenced by blender::gpu::render_graph::TEST(), blender::gpu::render_graph::TEST(), blender::gpu::render_graph::TEST(), blender::gpu::render_graph::TEST(), blender::gpu::render_graph::TEST(), blender::gpu::render_graph::TEST(), blender::gpu::render_graph::TEST(), blender::gpu::render_graph::TEST(), blender::gpu::render_graph::TEST(), blender::gpu::render_graph::TEST(), blender::gpu::render_graph::TEST(), blender::gpu::render_graph::TEST(), and blender::gpu::render_graph::TEST().

◆ submit_for_present()

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

◆ submit_synchronization_event()

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

◆ 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().

Friends And Related Symbol Documentation

◆ VKCommandBuilder

friend class VKCommandBuilder
friend

Definition at line 65 of file vk_render_graph.hh.

◆ VKScheduler

friend class VKScheduler
friend

Definition at line 66 of file vk_render_graph.hh.

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: