Blender V5.3
blender::gpu::render_graph::VKRenderGraphNode Struct Reference

#include <vk_render_graph_node.hh>

Classes

union  [union].__unnamed0__

Public Member Functions

template<typename NodeInfo>
void set_node_data (VKRenderGraphStorage &storage, const typename NodeInfo::CreateInfo &create_info)
template<typename NodeInfo>
void build_links (VKResourceStateTracker &resources, VKRenderGraphLinks &links, const typename NodeInfo::CreateInfo &create_info)
template<typename NodeInfo>
NodeInfo::Data & alloc_node_data (VKRenderGraphStorage &storage)
template<typename NodeInfo>
void finalize_node (VKRenderGraphStorage &storage, VKResourceStateTracker &resources, VKRenderGraphLinks &links, const typename NodeInfo::CreateInfo &create_info)
VkPipelineStageFlags pipeline_stage_get () const
void build_commands (VKCommandBufferInterface &command_buffer, VKRenderGraphStorage &storage, VKBoundPipelines &r_bound_pipelines)
void free_data ()
void reset ()

Public Attributes

VKNodeType type
union  
struct  links

Detailed Description

Node stored inside a render graph.

Node specific data in the render graph are stored in a vector to ensure that the data can be prefetched and removing a level of indirection. A consequence is that we cannot use class based nodes.

Definition at line 136 of file vk_render_graph_node.hh.

Member Function Documentation

◆ alloc_node_data()

template<typename NodeInfo>
NodeInfo::Data & blender::gpu::render_graph::VKRenderGraphNode::alloc_node_data ( VKRenderGraphStorage & storage)
inline

Allocate node data in storage for the new draw node model.

Sets the node type and returns a reference to the in-place data inside the render graph. Caller can then update the data directly, what will remove a copy later on. After the data is set, the caller needs to call finalize_node.

Currently only implemented for Draw nodes as other nodes don't benefit from this pattern.

Definition at line 212 of file vk_render_graph_node.hh.

References blender::BLI_assert(), storage, type, and blender::gpu::render_graph::UNUSED.

◆ build_commands()

void blender::gpu::render_graph::VKRenderGraphNode::build_commands ( VKCommandBufferInterface & command_buffer,
VKRenderGraphStorage & storage,
VKBoundPipelines & r_bound_pipelines )
inline

◆ build_links()

template<typename NodeInfo>
void blender::gpu::render_graph::VKRenderGraphNode::build_links ( VKResourceStateTracker & resources,
VKRenderGraphLinks & links,
const typename NodeInfo::CreateInfo & create_info )
inline

Build the input/output links for this.

Newly created links are added to the links parameter.

Definition at line 188 of file vk_render_graph_node.hh.

References blender::gpu::render_graph::VKRenderGraphLinks::buffers, blender::IndexRange::from_begin_end(), blender::gpu::render_graph::VKRenderGraphLinks::images, and links.

◆ finalize_node()

template<typename NodeInfo>
void blender::gpu::render_graph::VKRenderGraphNode::finalize_node ( VKRenderGraphStorage & storage,
VKResourceStateTracker & resources,
VKRenderGraphLinks & links,
const typename NodeInfo::CreateInfo & create_info )
inline

Finalize a node by building its resource links.

To be called after the caller has written data into the storage slot obtained via alloc_node_data.

Definition at line 226 of file vk_render_graph_node.hh.

References blender::gpu::render_graph::VKRenderGraphLinks::buffers, blender::IndexRange::from_begin_end(), blender::gpu::render_graph::VKRenderGraphLinks::images, links, and storage.

◆ free_data()

◆ pipeline_stage_get()

VkPipelineStageFlags blender::gpu::render_graph::VKRenderGraphNode::pipeline_stage_get ( ) const
inline

Get the pipeline stage of the node.

Pipeline stage is used to update src/dst_stage_masks of the VKCommandBuilder.

Definition at line 245 of file vk_render_graph_node.hh.

References blender::gpu::render_graph::BEGIN_QUERY, blender::gpu::render_graph::BEGIN_RENDERING, BLI_assert_unreachable, blender::gpu::render_graph::BLIT_IMAGE, blender::gpu::render_graph::BUILD_ACCELERATION_STRUCTURE, blender::gpu::render_graph::CLEAR_ATTACHMENTS, blender::gpu::render_graph::CLEAR_COLOR_IMAGE, blender::gpu::render_graph::CLEAR_DEPTH_STENCIL_IMAGE, blender::gpu::render_graph::COPY_BUFFER, blender::gpu::render_graph::COPY_BUFFER_TO_IMAGE, blender::gpu::render_graph::COPY_IMAGE, blender::gpu::render_graph::COPY_IMAGE_TO_BUFFER, blender::gpu::render_graph::DISPATCH, blender::gpu::render_graph::DISPATCH_INDIRECT, blender::gpu::render_graph::DRAW, blender::gpu::render_graph::DRAW_INDEXED, blender::gpu::render_graph::DRAW_INDEXED_INDIRECT, blender::gpu::render_graph::DRAW_INDIRECT, blender::gpu::render_graph::END_QUERY, blender::gpu::render_graph::END_RENDERING, blender::gpu::render_graph::FILL_BUFFER, blender::gpu::render_graph::VKDrawNodeInfo< VKNodeType::DRAW, VKDrawCreateInfo, VKDrawData, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, VKResourceType::IMAGE|VKResourceType::BUFFER >::pipeline_stage, blender::gpu::render_graph::VKDrawNodeInfo< VKNodeType::DRAW_INDEXED, VKDrawIndexedCreateInfo, VKDrawIndexedData, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, VKResourceType::IMAGE|VKResourceType::BUFFER >::pipeline_stage, blender::gpu::render_graph::VKDrawNodeInfo< VKNodeType::DRAW_INDEXED_INDIRECT, VKDrawIndexedIndirectCreateInfo, VKDrawIndexedIndirectData, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, VKResourceType::IMAGE|VKResourceType::BUFFER >::pipeline_stage, blender::gpu::render_graph::VKDrawNodeInfo< VKNodeType::DRAW_INDIRECT, VKDrawIndirectCreateInfo, VKDrawIndirectData, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, VKResourceType::IMAGE|VKResourceType::BUFFER >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::BEGIN_QUERY, VKBeginQueryData, VKBeginQueryData, VK_PIPELINE_STAGE_NONE, VKResourceType::NONE >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::BEGIN_RENDERING, VKBeginRenderingCreateInfo, VKBeginRenderingData, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, VKResourceType::IMAGE >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::BLIT_IMAGE, VKBlitImageData, VKBlitImageData, VK_PIPELINE_STAGE_TRANSFER_BIT, VKResourceType::IMAGE >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::BUILD_ACCELERATION_STRUCTURE, VKBuildAccelerationStructureCreateInfo, VKBuildAccelerationStructureData, VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR, VKResourceType::BUFFER >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::CLEAR_ATTACHMENTS, VKClearAttachmentsData, VKClearAttachmentsData, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT|VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT|VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, VKResourceType::IMAGE >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::CLEAR_COLOR_IMAGE, VKClearColorImageData, VKClearColorImageData, VK_PIPELINE_STAGE_TRANSFER_BIT, VKResourceType::IMAGE >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::CLEAR_DEPTH_STENCIL_IMAGE, VKClearDepthStencilImageCreateInfo, VKClearDepthStencilImageData, VK_PIPELINE_STAGE_TRANSFER_BIT, VKResourceType::IMAGE >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::COPY_BUFFER, VKCopyBufferData, VKCopyBufferData, VK_PIPELINE_STAGE_TRANSFER_BIT, VKResourceType::BUFFER >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::COPY_BUFFER_TO_IMAGE, VKCopyBufferToImageCreateInfo, VKCopyBufferToImageData, VK_PIPELINE_STAGE_TRANSFER_BIT, VKResourceType::IMAGE|VKResourceType::BUFFER >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::COPY_IMAGE, VKCopyImageCreateInfo, VKCopyImageData, VK_PIPELINE_STAGE_TRANSFER_BIT, VKResourceType::IMAGE >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::COPY_IMAGE_TO_BUFFER, VKCopyImageToBufferCreateInfo, VKCopyImageToBufferData, VK_PIPELINE_STAGE_TRANSFER_BIT, VKResourceType::IMAGE|VKResourceType::BUFFER >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::DISPATCH, VKDispatchCreateInfo, VKDispatchData, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VKResourceType::IMAGE|VKResourceType::BUFFER >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::DISPATCH_INDIRECT, VKDispatchIndirectCreateInfo, VKDispatchIndirectData, VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT|VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VKResourceType::IMAGE|VKResourceType::BUFFER >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::END_QUERY, VKEndQueryData, VKEndQueryData, VK_PIPELINE_STAGE_NONE, VKResourceType::IMAGE >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::END_RENDERING, VKEndRenderingData, VKEndRenderingData, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, VKResourceType::NONE >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::FILL_BUFFER, VKFillBufferData, VKFillBufferData, VK_PIPELINE_STAGE_TRANSFER_BIT, VKResourceType::BUFFER >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::RESET_QUERY_POOL, VKResetQueryPoolData, VKResetQueryPoolData, VK_PIPELINE_STAGE_NONE, VKResourceType::NONE >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::SYNCHRONIZATION, VKSynchronizationCreateInfo, VKSynchronizationData, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VKResourceType::IMAGE|VKResourceType::BUFFER >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::UPDATE_BUFFER, VKUpdateBufferData, VKUpdateBufferData, VK_PIPELINE_STAGE_TRANSFER_BIT, VKResourceType::BUFFER >::pipeline_stage, blender::gpu::render_graph::VKNodeInfo< VKNodeType::UPDATE_MIPMAPS, VKUpdateMipmapsData, VKUpdateMipmapsData, VK_PIPELINE_STAGE_TRANSFER_BIT, VKResourceType::IMAGE >::pipeline_stage, blender::gpu::render_graph::RESET_QUERY_POOL, blender::gpu::render_graph::SYNCHRONIZATION, type, blender::gpu::render_graph::UNUSED, blender::gpu::render_graph::UPDATE_BUFFER, and blender::gpu::render_graph::UPDATE_MIPMAPS.

◆ reset()

void blender::gpu::render_graph::VKRenderGraphNode::reset ( )
inline

Reset nodes.

Nodes are reset so they can be reused in consecutive calls. Data allocated by the node are freed. This function dispatches the free_data to the actual node implementation.

Definition at line 424 of file vk_render_graph_node.hh.

References free_data(), type, and blender::gpu::render_graph::UNUSED.

◆ set_node_data()

template<typename NodeInfo>
void blender::gpu::render_graph::VKRenderGraphNode::set_node_data ( VKRenderGraphStorage & storage,
const typename NodeInfo::CreateInfo & create_info )
inline

Set the data of the node.

Pre-conditions:

  • type of the node should be VKNodeType::UNUSED. Memory allocated for nodes are reused between consecutive use. Checking for unused node types will ensure that previous usage has been reset. Resetting is done as part of free_data

Definition at line 171 of file vk_render_graph_node.hh.

References blender::BLI_assert(), storage, type, and blender::gpu::render_graph::UNUSED.

Member Data Documentation

◆ @223017353213165140336044104030124312333266200030

◆ links

struct blender::gpu::render_graph::VKRenderGraphNode::[struct].links blender::gpu::render_graph::VKRenderGraphNode::links

Referenced by build_links(), and finalize_node().

◆ type

VKNodeType blender::gpu::render_graph::VKRenderGraphNode::type

The documentation for this struct was generated from the following file: