Blender V5.0
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
10#include "vk_buffer.hh"
11#include "vk_common.hh"
12
13#include "BLI_vector.hh"
14
15#pragma once
16
17namespace blender::gpu {
18
19class VKVertexBuffer;
20class VKContext;
21class VKBatch;
23class VKImmediate;
24
25using AttributeMask = uint16_t;
26
27/* TODO: VKVertexAttributeObject should not contain any reference to VBO's. This should make the
28 * API be compatible with both #VKBatch and #VKImmediate. */
29/* TODO: In steam of storing the bindings/attributes we should add a data structure that can store
30 * them. Building the bindings/attributes should be done inside #VKPipelinePool. */
32 public:
33 bool is_valid = false;
34 VkPipelineVertexInputStateCreateInfo info = {
35 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, NULL};
36
39 /* Used for batches. */
41 /* Used for immediate mode. */
43
45 void clear();
46
47 void bind(render_graph::VKVertexBufferBindings &r_vertex_buffer_bindings) const;
48
51
52 void update_bindings(const VKContext &context, VKBatch &batch);
53 void update_bindings(VKImmediate &immediate);
54
55 void debug_print() const;
56
57 private:
59 void fill_unused_bindings(const VKShaderInterface &interface,
60 const AttributeMask occupied_attributes);
61 void update_bindings(const GPUVertFormat &vertex_format,
62 VKVertexBuffer *vertex_buffer,
63 VKBufferWithOffset *immediate_vertex_buffer,
64 const int64_t vertex_len,
66 AttributeMask &r_occupied_attributes);
67};
68
69} // namespace blender::gpu
long long int int64_t
VKVertexAttributeObject & operator=(const VKVertexAttributeObject &other)
Vector< VkVertexInputAttributeDescription > attributes
void update_bindings(const VKContext &context, VKBatch &batch)
VkPipelineVertexInputStateCreateInfo info
Vector< VkVertexInputBindingDescription > bindings
void bind(render_graph::VKVertexBufferBindings &r_vertex_buffer_bindings) const
struct @021025263243242147216143265077100330027142264337::@225245033123204053237120173316075113304004012000 batch