Blender V5.0
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
8
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, typename Storage>
43 static void set_node_data(Node &node, Storage & /* storage */, const CreateInfo &create_info)
44 {
45 UNUSED_VARS(create_info);
46 node.synchronization = {};
47 }
48
53 VKRenderGraphNodeLinks &node_links,
54 const CreateInfo &create_info) override
55 {
57 node_links.outputs.append(
58 {resource, VK_ACCESS_NONE, create_info.vk_image_layout, create_info.vk_image_aspect});
59 }
60
65 Data &data,
66 VKBoundPipelines & /*r_bound_pipelines*/) override
67 {
68 UNUSED_VARS(command_buffer, data);
69 /* Intentionally left empty: A pipeline barrier has already been send to the command buffer.
70 */
71 }
72};
73} // namespace blender::gpu::render_graph
#define UNUSED_VARS(...)
BMesh const char void * data
ResourceWithStamp get_image_and_increase_stamp(VkImage vk_image)
static void set_node_data(Node &node, Storage &, const CreateInfo &create_info)
void build_commands(VKCommandBufferInterface &command_buffer, Data &data, VKBoundPipelines &) override
void build_links(VKResourceStateTracker &resources, VKRenderGraphNodeLinks &node_links, const CreateInfo &create_info) override
#define resource