Blender V5.0
vk_scheduler.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
11
12#pragma once
13
14#include "BLI_vector.hh"
15
16#include "vk_common.hh"
18
20class VKRenderGraph;
21
48 private:
53 Vector<NodeHandle> result_;
54
55 public:
64
65 private:
66 void reorder_nodes(const VKRenderGraph &render_graph);
67
74 void move_initial_transfer_to_start(const VKRenderGraph &render_graph);
75
92 void move_transfer_and_dispatch_outside_rendering_scope(const VKRenderGraph &render_graph);
93
97 std::optional<std::pair<int64_t, int64_t>> find_rendering_scope(
98 const VKRenderGraph &render_graph, IndexRange search_range) const;
99 template<typename FuncT>
100 void foreach_rendering_scope(const VKRenderGraph &render_graph, const FuncT &func) const
101 {
102 for (std::optional<std::pair<int64_t, int64_t>> rendering_scope =
103 find_rendering_scope(render_graph, IndexRange(result_.index_range()));
104 rendering_scope.has_value();
105 rendering_scope =
106 find_rendering_scope(render_graph,
107 IndexRange(rendering_scope.value().second + 1,
108 result_.size() - rendering_scope.value().second - 1)))
109 {
110 func(rendering_scope.value().first, rendering_scope.value().second);
111 }
112 }
113
114 void debug_print(const VKRenderGraph &render_graph) const;
115};
116
117} // namespace blender::gpu::render_graph
Span< NodeHandle > select_nodes(const VKRenderGraph &render_graph)