Blender V4.3
vk_clear_attachments_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
12#include "vk_node_info.hh"
13
15
21 VkClearAttachment attachments[8];
22 VkClearRect vk_clear_rect;
23};
24
25class VKClearAttachmentsNode : public VKNodeInfo<VKNodeType::CLEAR_ATTACHMENTS,
26 VKClearAttachmentsData,
27 VKClearAttachmentsData,
28 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT |
29 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT |
30 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
31 VKResourceType::IMAGE> {
32 public:
40 template<typename Node> static void set_node_data(Node &node, const CreateInfo &create_info)
41 {
42 node.clear_attachments = create_info;
43 }
44
49 VKRenderGraphNodeLinks &node_links,
50 const CreateInfo &create_info) override
51 {
52 UNUSED_VARS(resources, node_links, create_info);
53 }
54
59 Data &data,
60 VKBoundPipelines & /*r_bound_pipelines*/) override
61 {
62 command_buffer.clear_attachments(
63 data.attachment_count, data.attachments, 1, &data.vk_clear_rect);
64 }
65};
66} // namespace blender::gpu::render_graph
#define UNUSED_VARS(...)
void build_commands(VKCommandBufferInterface &command_buffer, Data &data, VKBoundPipelines &) override
void build_links(VKResourceStateTracker &resources, VKRenderGraphNodeLinks &node_links, const CreateInfo &create_info) override
static void set_node_data(Node &node, const CreateInfo &create_info)
virtual void clear_attachments(uint32_t attachment_count, const VkClearAttachment *p_attachments, uint32_t rect_count, const VkClearRect *p_rects)=0
unsigned int uint32_t
Definition stdint.h:80