Blender V4.3
vk_drawlist.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
12
13#include "vk_buffer.hh"
15
16namespace blender::gpu {
17class VKBatch;
18
19class VKDrawList : public DrawList, VKResourceTracker<VKBuffer> {
20 private:
24 VKBatch *batch_ = nullptr;
25
30 const int length_;
31
35 int command_index_ = 0;
36
37 public:
38 VKDrawList(int list_length);
39
45 void append(Batch *batch, int instance_first, int instance_count) override;
46
52 void submit() override;
53
54 private:
59 template<typename CommandType> CommandType &get_command(VKBuffer &buffer) const
60 {
61 return MutableSpan<CommandType>(static_cast<CommandType *>(buffer.mapped_memory_get()),
62 length_)[command_index_];
63 }
64
65 protected:
66 std::unique_ptr<VKBuffer> create_resource(VKContext &context) override;
67};
68
69} // namespace blender::gpu
void * mapped_memory_get() const
Definition vk_buffer.cc:151
void submit() override
VKDrawList(int list_length)
std::unique_ptr< VKBuffer > create_resource(VKContext &context) override
append
struct @620::@622 batch