Blender V5.3
vk_dispatch_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
8
9#pragma once
10
13#include "vk_node_info.hh"
14
25
34
35class VKDispatchNode : public VKNodeInfo<VKNodeType::DISPATCH,
36 VKDispatchCreateInfo,
37 VKDispatchData,
38 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
39 VKResourceType::IMAGE | VKResourceType::BUFFER> {
40 public:
48 template<typename Node, typename Storage>
49 static void set_node_data(Node &node, Storage & /* storage */, const CreateInfo &create_info)
50 {
51 node.dispatch = create_info.dispatch_node;
52 }
53
58 VKRenderGraphLinks &links,
59 const CreateInfo &create_info) override
60 {
61 create_info.resources.build_links(resources, links);
62 }
63
68 Data &data,
69 Span<uint8_t> storage_push_constants,
70 VKBoundPipelines &r_bound_pipelines) override
71 {
73 data.pipeline_data,
74 storage_push_constants,
75 r_bound_pipelines.compute,
76 VK_PIPELINE_BIND_POINT_COMPUTE,
77 VK_SHADER_STAGE_COMPUTE_BIT);
78 command_buffer.dispatch(data.group_count_x, data.group_count_y, data.group_count_z);
79 }
80};
81} // namespace blender::gpu::render_graph
NonCopyable(const NonCopyable &other)=delete
virtual void dispatch(uint32_t group_count_x, uint32_t group_count_y, uint32_t group_count_z)=0
void build_links(VKResourceStateTracker &resources, VKRenderGraphLinks &links, const CreateInfo &create_info) override
static void set_node_data(Node &node, Storage &, const CreateInfo &create_info)
void build_commands(VKCommandBufferInterface &command_buffer, Data &data, Span< uint8_t > storage_push_constants, VKBoundPipelines &r_bound_pipelines) override
void vk_pipeline_data_build_commands(VKCommandBufferInterface &command_buffer, const VKPipelineData &pipeline_data, Span< uint8_t > storage_push_constants, VKBoundPipeline &r_bound_pipeline, VkPipelineBindPoint vk_pipeline_bind_point, VkShaderStageFlags vk_shader_stage_flags)
unsigned int uint32_t
Definition BKE_text.h:81
BMesh const char void * data
VKDispatchCreateInfo(const VKResourceAccessInfo &resources)
void build_links(VKResourceStateTracker &resources, VKRenderGraphLinks &links) const