Blender V4.3
vk_render_graph_node.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
26#include "nodes/vk_draw_node.hh"
34
36
41
51 union {
75 };
76
85 template<typename NodeInfo> void set_node_data(const typename NodeInfo::CreateInfo &create_info)
86 {
88 /* Instance of NodeInfo is needed to call virtual methods. CPP doesn't support overloading of
89 * static methods.*/
90 NodeInfo node_info;
91 type = NodeInfo::node_type;
92 node_info.set_node_data(*this, create_info);
93 }
94
100 template<typename NodeInfo>
102 VKRenderGraphNodeLinks &node_links,
103 const typename NodeInfo::CreateInfo &create_info)
104 {
105 /* Instance of NodeInfo is needed to call virtual methods. CPP doesn't support overloading of
106 * static methods.*/
107 NodeInfo node_info;
108 node_info.build_links(resources, node_links, create_info);
109 }
110
116 VkPipelineStageFlags pipeline_stage_get() const
117 {
118 switch (type) {
120 return VK_PIPELINE_STAGE_NONE;
151 case VKNodeType::DRAW:
167 }
169 return VK_PIPELINE_STAGE_NONE;
170 }
171
179 VKBoundPipelines &r_bound_pipelines)
180 {
181 switch (type) {
182 case VKNodeType::UNUSED: {
183 break;
184 }
185#define BUILD_COMMANDS(NODE_TYPE, NODE_CLASS, ATTRIBUTE_NAME) \
186 case NODE_TYPE: { \
187 NODE_CLASS node_info; \
188 node_info.build_commands(command_buffer, ATTRIBUTE_NAME, r_bound_pipelines); \
189 break; \
190 }
191
220#undef BUILD_COMMANDS
221 }
222 }
223
268
275 void reset()
276 {
277 free_data();
278 memset(this, 0, sizeof(VKRenderGraphNode));
279 type = VKNodeType::UNUSED;
280 }
281};
282
283} // namespace blender::gpu::render_graph
#define BLI_assert_unreachable()
Definition BLI_assert.h:97
#define BLI_assert(a)
Definition BLI_assert.h:50
unsigned __int64 uint64_t
Definition stdint.h:90
void build_links(VKResourceStateTracker &resources, VKRenderGraphNodeLinks &node_links, const typename NodeInfo::CreateInfo &create_info)
VKDrawIndexedIndirectNode::Data draw_indexed_indirect
VKClearDepthStencilImageNode::Data clear_depth_stencil_image
void build_commands(VKCommandBufferInterface &command_buffer, VKBoundPipelines &r_bound_pipelines)
void set_node_data(const typename NodeInfo::CreateInfo &create_info)
#define BUILD_COMMANDS(NODE_TYPE, NODE_CLASS, ATTRIBUTE_NAME)
#define FREE_DATA(NODE_TYPE, NODE_CLASS, ATTRIBUTE_NAME)