Blender V5.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
8
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, typename Storage>
41 void set_node_data(Node &node, Storage &storage, const CreateInfo &create_info)
42 {
43 node.storage_index = storage.clear_attachments.append_and_get_index(create_info);
44 }
45
49 void build_links(VKResourceStateTracker & /*resources*/,
50 VKRenderGraphLinks & /*links*/,
51 const CreateInfo & /*create_info*/) override
52 {
53 }
54
59 Data &data,
60 Span<uint8_t> /*storage_push_constants*/,
61 VKBoundPipelines & /*r_bound_pipelines*/) override
62 {
63 command_buffer.clear_attachments(
64 data.attachment_count, data.attachments, 1, &data.vk_clear_rect);
65 }
66};
67} // namespace blender::gpu::render_graph
void set_node_data(Node &node, Storage &storage, const CreateInfo &create_info)
void build_commands(VKCommandBufferInterface &command_buffer, Data &data, Span< uint8_t >, VKBoundPipelines &) override
void build_links(VKResourceStateTracker &, VKRenderGraphLinks &, const CreateInfo &) override
virtual void clear_attachments(uint32_t attachment_count, const VkClearAttachment *p_attachments, uint32_t rect_count, const VkClearRect *p_rects)=0
#define storage(slot, qualifiers)
unsigned int uint32_t
Definition BKE_text.h:81
BMesh const char void * data