Blender V5.0
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
34
35class VKClearDepthStencilImageNode : public VKNodeInfo<VKNodeType::CLEAR_DEPTH_STENCIL_IMAGE,
36 VKClearDepthStencilImageCreateInfo,
37 VKClearDepthStencilImageData,
38 VK_PIPELINE_STAGE_TRANSFER_BIT,
39 VKResourceType::IMAGE> {
40 public:
48 template<typename Node, typename Storage>
49 static void set_node_data(Node &node, Storage & /* storage */, const CreateInfo &create_info)
50 {
51 node.clear_depth_stencil_image = create_info.node_data;
52 }
53
58 VKRenderGraphNodeLinks &node_links,
59 const CreateInfo &create_info) override
60 {
62 create_info.node_data.vk_image);
63 node_links.outputs.append({resource,
64 VK_ACCESS_TRANSFER_WRITE_BIT,
65 VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
66 create_info.vk_image_aspects});
67 }
68
73 Data &data,
74 VKBoundPipelines & /*r_bound_pipelines*/) override
75 {
76 command_buffer.clear_depth_stencil_image(data.vk_image,
77 VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
78 &data.vk_clear_depth_stencil_value,
79 1,
80 &data.vk_image_subresource_range);
81 }
82};
83} // namespace blender::gpu::render_graph
BMesh const char void * data
void build_commands(VKCommandBufferInterface &command_buffer, Data &data, VKBoundPipelines &) override
static void set_node_data(Node &node, Storage &, const CreateInfo &create_info)
void build_links(VKResourceStateTracker &resources, VKRenderGraphNodeLinks &node_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)
#define resource