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

#include <vk_render_graph.hh>

Inherits blender::blender::NonCopyable.

Public Member Functions

template<typename NodeInfo>
VKNodeData< NodeInfo > alloc_node ()
template<typename NodeInfo>
void finalize_node (NodeHandle node_handle, const typename NodeInfo::CreateInfo &create_info)
VKCopyBufferNode::Data & get_node_data (NodeHandle node_handle)
IndexRange copy_push_constants (Span< uint8_t > push_constants)
NodeHandle next_node_handle ()
bool is_empty ()
void deref_resources ()
Span< VKRenderGraphImage > linked_images (const VKRenderGraphNode &node) const
Span< VKRenderGraphImage > linked_images (const NodeHandle node_handle) const
Span< VKRenderGraphBuffer > linked_buffers (const VKRenderGraphNode &node) const
Span< VKRenderGraphBuffer > linked_buffers (const NodeHandle node_handle) const
Render Graph
 VKRenderGraph (VKResourceStateTracker &resources)
void reset ()
void memstats () const
Debug
void debug_group_begin (const char *name, const ColorTheme4f &color)
void debug_group_end ()
std::string full_debug_group (NodeHandle node_handle) const
void debug_print (NodeHandle node_handle) const
Public Member Functions inherited from blender::blender::NonCopyable
 NonCopyable (const NonCopyable &other)=delete
NonCopyable & operator= (const NonCopyable &other)=delete
 NonCopyable ()=default
 NonCopyable (NonCopyable &&other)=default
NonCopyable & operator= (NonCopyable &&other)=default

Friends

class VKCommandBuilder
class VKScheduler

Detailed Description

Definition at line 79 of file vk_render_graph.hh.

Constructor & Destructor Documentation

◆ VKRenderGraph()

blender::gpu::render_graph::VKRenderGraph::VKRenderGraph ( 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 20 of file vk_render_graph.cc.

Member Function Documentation

◆ alloc_node()

template<typename NodeInfo>
VKNodeData< NodeInfo > blender::gpu::render_graph::VKRenderGraph::alloc_node ( )
inline

Allocate a draw node in the render graph.

Returns a reference to the in-place storage data that the caller can fill before calling finalize_node.

Definition at line 161 of file vk_render_graph.hh.

References blender::data, and node.

Referenced by blender::gpu::VKBatch::draw(), blender::gpu::VKImmediate::end(), and blender::gpu::VKBatch::multi_draw_indirect().

◆ copy_push_constants()

IndexRange blender::gpu::render_graph::VKRenderGraph::copy_push_constants ( Span< uint8_t > push_constants)
inline

To reduce small allocations the caller can copy push constants inside the render graph. The returned index range can than be used by the command builder to retrieve the push constants.

Definition at line 306 of file vk_render_graph.hh.

References blender::IndexRange::from_begin_size(), and blender::Span< T >::size().

◆ debug_group_begin()

void blender::gpu::render_graph::VKRenderGraph::debug_group_begin ( const char * name,
const ColorTheme4f & color )

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 73 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 84 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

Definition at line 90 of file vk_render_graph.cc.

References node.

◆ deref_resources()

void blender::gpu::render_graph::VKRenderGraph::deref_resources ( )
inline

Release the graph's reference to each in-use resource.

Call once after the graph's work has been submitted; zero-ref resources become discardable.

Definition at line 365 of file vk_render_graph.hh.

Referenced by reset().

◆ finalize_node()

template<typename NodeInfo>
void blender::gpu::render_graph::VKRenderGraph::finalize_node ( NodeHandle node_handle,
const typename NodeInfo::CreateInfo & create_info )
inline

Finalize a draw node that was previously allocated via alloc_node.

Builds resource links, records debug groups, etc.

Definition at line 176 of file vk_render_graph.hh.

References blender::BLI_assert(), finalize_node(), blender::G, blender::G_DEBUG_GPU, lock, and node.

Referenced by finalize_node().

◆ full_debug_group()

std::string blender::gpu::render_graph::VKRenderGraph::full_debug_group ( NodeHandle node_handle) const

Return the full debug group of the given node_handle. Returns an empty string when debug groups are not enabled (--debug-gpu).

Definition at line 98 of file vk_render_graph.cc.

References blender::G, and blender::G_DEBUG_GPU.

◆ get_node_data()

VKCopyBufferNode::Data & blender::gpu::render_graph::VKRenderGraph::get_node_data ( NodeHandle node_handle)
inline

Get the reference to the node data for a VKCopyBufferNode.

Allows altering a previous added node. Is useful to reduce barriers when a streaming buffer requires data that can still fit in the previous copy command.

Definition at line 294 of file vk_render_graph.hh.

References blender::BLI_assert(), blender::gpu::render_graph::COPY_BUFFER, and node.

◆ is_empty()

bool blender::gpu::render_graph::VKRenderGraph::is_empty ( )
inline

Definition at line 346 of file vk_render_graph.hh.

◆ linked_buffers() [1/2]

Span< VKRenderGraphBuffer > blender::gpu::render_graph::VKRenderGraph::linked_buffers ( const NodeHandle node_handle) const
inline

Get the buffers that are linked by the given node_handle.

Definition at line 389 of file vk_render_graph.hh.

References linked_buffers().

◆ linked_buffers() [2/2]

Span< VKRenderGraphBuffer > blender::gpu::render_graph::VKRenderGraph::linked_buffers ( const VKRenderGraphNode & node) const
inline

Get the buffers that are linked by the given node.

Definition at line 384 of file vk_render_graph.hh.

References node.

Referenced by linked_buffers().

◆ linked_images() [1/2]

Span< VKRenderGraphImage > blender::gpu::render_graph::VKRenderGraph::linked_images ( const NodeHandle node_handle) const
inline

Get the images that are linked by the given node_handle.

Definition at line 379 of file vk_render_graph.hh.

References linked_images().

◆ linked_images() [2/2]

Span< VKRenderGraphImage > blender::gpu::render_graph::VKRenderGraph::linked_images ( const VKRenderGraphNode & node) const
inline

Get the images that are linked by the given node.

Definition at line 374 of file vk_render_graph.hh.

References node.

Referenced by linked_images().

◆ memstats()

void blender::gpu::render_graph::VKRenderGraph::memstats ( ) const

Definition at line 43 of file vk_render_graph.cc.

References PRINT_STORAGE.

Referenced by reset().

◆ 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 341 of file vk_render_graph.hh.

◆ reset()

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

Reset the render graph.

Clears the nodes, links and storage, and releases the graph's resource references.

Definition at line 22 of file vk_render_graph.cc.

References deref_resources(), memstats(), and node.

◆ VKCommandBuilder

friend class VKCommandBuilder
friend

Definition at line 80 of file vk_render_graph.hh.

References VKCommandBuilder.

Referenced by VKCommandBuilder.

◆ VKScheduler

friend class VKScheduler
friend

Definition at line 81 of file vk_render_graph.hh.

References b, hash, blender::gpu::operator==(), and VKScheduler.

Referenced by VKScheduler.


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