Blender V5.3
vk_clear_depth_stencil_image_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 VkImage vk_image;
20 VkClearDepthStencilValue vk_clear_depth_stencil_value;
21 VkImageSubresourceRange vk_image_subresource_range;
22};
23
35
36class VKClearDepthStencilImageNode : public VKNodeInfo<VKNodeType::CLEAR_DEPTH_STENCIL_IMAGE,
37 VKClearDepthStencilImageCreateInfo,
38 VKClearDepthStencilImageData,
39 VK_PIPELINE_STAGE_TRANSFER_BIT,
40 VKResourceType::IMAGE> {
41 public:
49 template<typename Node, typename Storage>
50 static void set_node_data(Node &node, Storage & /* storage */, const CreateInfo &create_info)
51 {
52 node.clear_depth_stencil_image = create_info.node_data;
53 }
54
59 VKRenderGraphLinks &links,
60 const CreateInfo &create_info) override
61 {
63 create_info.node_data.vk_image);
64 links.images.append({{resource, VK_ACCESS_TRANSFER_WRITE_BIT},
65 VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
66 create_info.vk_image_aspects});
67 }
68
73 Data &data,
74 Span<uint8_t> /*storage_push_constants*/,
75 VKBoundPipelines & /*r_bound_pipelines*/) override
76 {
77 command_buffer.clear_depth_stencil_image(data.vk_image,
78 VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
79 &data.vk_clear_depth_stencil_value,
80 1,
81 &data.vk_image_subresource_range);
82 }
83};
84} // namespace blender::gpu::render_graph
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
virtual void clear_depth_stencil_image(VkImage image, VkImageLayout image_layout, const VkClearDepthStencilValue *p_depth_stencil, uint32_t range_count, const VkImageSubresourceRange *p_ranges)=0
ResourceWithStamp get_image_and_increase_stamp(VkImage vk_image)
BMesh const char void * data