Blender V5.0
vk_render_graph_links.cc
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#include <sstream>
10
12#include "vk_to_string.hh"
13
15
16void VKRenderGraphLink::debug_print(std::ostream &ss,
17 const VKResourceStateTracker &resources) const
18{
19 const VKResourceStateTracker::Resource &tracked_resource = resources.resources_.lookup(
20 resource.handle);
21 ss << "handle=" << resource.handle;
22 ss << ", type=";
23
24 switch (tracked_resource.type) {
26 ss << "BUFFER";
27 ss << ", vk_handle=" << uint64_t(tracked_resource.buffer.vk_buffer);
28#ifndef NDEBUG
29 if (tracked_resource.name) {
30 ss << ", name=" << tracked_resource.name;
31 }
32#endif
33 ss << ", vk_access=" << to_string_vk_access_flags(vk_access_flags);
34 break;
35 }
37 ss << "IMAGE";
38 ss << ", vk_handle=" << uint64_t(tracked_resource.image.vk_image);
39#ifndef NDEBUG
40 if (tracked_resource.name) {
41 ss << ", name=" << tracked_resource.name;
42 }
43#endif
44 ss << ", vk_access=" << to_string_vk_access_flags(vk_access_flags);
45 ss << ", vk_image_layout=" << to_string(vk_image_layout);
46 ss << ", vk_image_aspect=" << to_string_vk_image_aspect_flags(vk_image_aspect);
47 ss << ", layer_base=" << subimage.layer_base;
48 ss << ", mipmap_level=" << subimage.mipmap_level;
49 break;
50 }
52 ss << "NONE";
53 break;
54 }
55 }
56}
57
59{
60 std::stringstream ss;
61 for (const VKRenderGraphLink &link : inputs) {
62 ss << "- input ";
63 link.debug_print(ss, resources);
64 ss << "\n";
65 }
66 for (const VKRenderGraphLink &link : outputs) {
67 ss << "- output ";
68 link.debug_print(ss, resources);
69 ss << "\n";
70 }
71
72 std::cout << ss.str();
73}
74
75} // namespace blender::gpu::render_graph
unsigned long long int uint64_t
const Value & lookup(const Key &key) const
Definition BLI_map.hh:545
const char * to_string(ShaderStage stage)
Definition mtl_shader.mm:51
std::string to_string_vk_image_aspect_flags(const VkImageAspectFlags vk_image_aspect_flags)
std::string to_string_vk_access_flags(const VkAccessFlags vk_access_flags)