Blender V4.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
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;
22class VKShaderInterface;
23class VKImmediate;
24
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,
65 const VKShaderInterface &interface,
66 AttributeMask &r_occupied_attributes,
67 const bool use_instancing);
68};
69
70} // namespace blender::gpu
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
#define NULL
struct @620::@622 batch
unsigned short uint16_t
Definition stdint.h:79
__int64 int64_t
Definition stdint.h:89