Blender V4.3
vk_synchronization_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
11#include "vk_node_info.hh"
12
14
19
24 VkImage vk_image;
25 VkImageLayout vk_image_layout;
26 VkImageAspectFlags vk_image_aspect;
27};
28
29class VKSynchronizationNode : public VKNodeInfo<VKNodeType::SYNCHRONIZATION,
30 VKSynchronizationCreateInfo,
31 VKSynchronizationData,
32 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
33 VKResourceType::IMAGE | VKResourceType::BUFFER> {
34 public:
42 template<typename Node> static void set_node_data(Node &node, const CreateInfo &create_info)
43 {
44 UNUSED_VARS(create_info);
45 node.synchronization = {};
46 }
47
52 VKRenderGraphNodeLinks &node_links,
53 const CreateInfo &create_info) override
54 {
55 ResourceWithStamp resource = resources.get_image_and_increase_stamp(create_info.vk_image);
56 node_links.outputs.append(
57 {resource, VK_ACCESS_NONE, create_info.vk_image_layout, create_info.vk_image_aspect});
58 }
59
64 Data &data,
65 VKBoundPipelines & /*r_bound_pipelines*/) override
66 {
67 UNUSED_VARS(command_buffer, data);
68 /* Intentionally left empty: A pipeline barrier has already been send to the command buffer.
69 */
70 }
71};
72} // namespace blender::gpu::render_graph
#define UNUSED_VARS(...)
ResourceWithStamp get_image_and_increase_stamp(VkImage vk_image)
void build_commands(VKCommandBufferInterface &command_buffer, Data &data, VKBoundPipelines &) override
static void set_node_data(Node &node, const CreateInfo &create_info)
void build_links(VKResourceStateTracker &resources, VKRenderGraphNodeLinks &node_links, const CreateInfo &create_info) override