Blender V5.3
vk_vertex_attribute_object.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
12#include "vk_buffer.hh"
14
15namespace blender::gpu {
16
17class VKVertexBuffer;
18class VKContext;
19class VKBatch;
21class VKImmediate;
22
24
25/* TODO: VKVertexAttributeObject should not contain any reference to VBO's. This should make the
26 * API be compatible with both #VKBatch and #VKImmediate. */
27/* TODO: In steam of storing the bindings/attributes we should add a data structure that can store
28 * them. Building the bindings/attributes should be done inside #VKPipelinePool. */
30 public:
37
38 /* Used for batches. */
40 /* Used for immediate mode. */
42
44 void clear();
45
47
48 void bind(render_graph::VKVertexBufferBindings &r_vertex_buffer_bindings) const;
49
52
53 void update_bindings(const VKContext &context, VKBatch &batch);
54 void update_bindings(VKImmediate &immediate);
55
56 void debug_print() const;
57
58 private:
60 void fill_unused_bindings(const VKShaderInterface &interface,
61 const AttributeMask occupied_attributes);
62 void update_bindings(const GPUVertFormat &vertex_format,
63 VKVertexBuffer *vertex_buffer,
64 VKBufferWithOffset *immediate_vertex_buffer,
65 const int64_t vertex_len,
66 const VKShaderInterface &interface,
67 AttributeMask &r_occupied_attributes);
68};
69
70} // namespace blender::gpu
VKVertexAttributeObject & operator=(const VKVertexAttributeObject &other)
void update_bindings(const VKContext &context, VKBatch &batch)
void bind(render_graph::VKVertexBufferBindings &r_vertex_buffer_bindings) const
VKVertexInputDescriptionPool::Key vertex_input_key
void update_vertex_input_key(VKVertexInputDescriptionPool &pool)
Pool with all used vertex input descriptions.
__int64 int64_t
Definition BKE_text.h:90
unsigned short uint16_t
Definition BKE_text.h:80
Description of vertex inputs used by graphic pipelines.