Blender V5.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
8
9#pragma once
10
11#include "vk_node_info.hh"
12
14
22
27 VkImage vk_image;
28 VkImageLayout vk_image_layout;
29 VkImageAspectFlags vk_image_aspect;
31 VkAccessFlags vk_access_flags;
40};
41
42class VKSynchronizationNode : public VKNodeInfo<VKNodeType::SYNCHRONIZATION,
43 VKSynchronizationCreateInfo,
44 VKSynchronizationData,
45 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
46 VKResourceType::IMAGE | VKResourceType::BUFFER> {
47 public:
55 template<typename Node, typename Storage>
56 static void set_node_data(Node &node, Storage & /* storage */, const CreateInfo &create_info)
57 {
58 node.synchronization = {create_info.reset_layout_to_undefined};
59 }
60
65 VKRenderGraphLinks &links,
66 const CreateInfo &create_info) override
67 {
68 ResourceWithStamp resource = resources.get_image_and_increase_stamp(create_info.vk_image);
69 links.images.append({{resource, create_info.vk_access_flags},
70 create_info.vk_image_layout,
71 create_info.vk_image_aspect});
72 }
73
78 Data &data,
79 Span<uint8_t> /*storage_push_constants*/,
80 VKBoundPipelines & /*r_bound_pipelines*/) override
81 {
82 UNUSED_VARS(command_buffer, data);
83 /* Intentionally left empty: A pipeline barrier has already been send to the command buffer.
84 */
85 }
86};
87} // namespace blender::gpu::render_graph
#define UNUSED_VARS(...)
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, Span< uint8_t >, VKBoundPipelines &) override
void build_links(VKResourceStateTracker &resources, VKRenderGraphLinks &links, const CreateInfo &create_info) override
BMesh const char void * data