Blender V4.3
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
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(
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=" << layer_base;
48 break;
49 }
51 ss << "NONE";
52 break;
53 }
54 }
55}
56
58{
59 std::stringstream ss;
60 for (const VKRenderGraphLink &link : inputs) {
61 ss << "- input ";
62 link.debug_print(ss, resources);
63 ss << "\n";
64 }
65 for (const VKRenderGraphLink &link : outputs) {
66 ss << "- output ";
67 link.debug_print(ss, resources);
68 ss << "\n";
69 }
70
71 std::cout << ss.str();
72}
73
74} // namespace blender::gpu::render_graph
const Value & lookup(const Key &key) const
Definition BLI_map.hh:506
const char * to_string(ShaderStage stage)
Definition mtl_shader.mm:52
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)
unsigned __int64 uint64_t
Definition stdint.h:90