Blender
V4.3
source
blender
gpu
vulkan
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
9
#include "
render_graph/vk_render_graph.hh
"
10
#include "
vk_buffer.hh
"
11
#include "
vk_common.hh
"
12
13
#include "
BLI_vector.hh
"
14
15
#pragma once
16
17
namespace
blender::gpu
{
18
19
class
VKVertexBuffer;
20
class
VKContext;
21
class
VKBatch;
22
class
VKShaderInterface;
23
class
VKImmediate;
24
25
using
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. */
31
class
VKVertexAttributeObject
{
32
public
:
33
bool
is_valid
=
false
;
34
VkPipelineVertexInputStateCreateInfo
info
= {
35
VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO,
NULL
};
36
37
Vector<VkVertexInputBindingDescription>
bindings
;
38
Vector<VkVertexInputAttributeDescription>
attributes
;
39
/* Used for batches. */
40
Vector<VKVertexBuffer *>
vbos
;
41
/* Used for immediate mode. */
42
Vector<VKBufferWithOffset>
buffers
;
43
44
VKVertexAttributeObject
();
45
void
clear
();
46
47
void
bind
(
render_graph::VKVertexBufferBindings
&r_vertex_buffer_bindings)
const
;
48
50
VKVertexAttributeObject
&
operator=
(
const
VKVertexAttributeObject
&other);
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
BLI_vector.hh
blender::Vector
Definition
BLI_vector.hh:65
blender::gpu::VKBatch
Definition
vk_batch.hh:19
blender::gpu::VKContext
Definition
vk_context.hh:29
blender::gpu::VKImmediate
Definition
vk_immediate.hh:31
blender::gpu::VKShaderInterface
Definition
vk_shader_interface.hh:33
blender::gpu::VKVertexAttributeObject
Definition
vk_vertex_attribute_object.hh:31
blender::gpu::VKVertexAttributeObject::buffers
Vector< VKBufferWithOffset > buffers
Definition
vk_vertex_attribute_object.hh:42
blender::gpu::VKVertexAttributeObject::VKVertexAttributeObject
VKVertexAttributeObject()
Definition
vk_vertex_attribute_object.cc:18
blender::gpu::VKVertexAttributeObject::operator=
VKVertexAttributeObject & operator=(const VKVertexAttributeObject &other)
Definition
vk_vertex_attribute_object.cc:33
blender::gpu::VKVertexAttributeObject::attributes
Vector< VkVertexInputAttributeDescription > attributes
Definition
vk_vertex_attribute_object.hh:38
blender::gpu::VKVertexAttributeObject::debug_print
void debug_print() const
Definition
vk_vertex_attribute_object.cc:322
blender::gpu::VKVertexAttributeObject::update_bindings
void update_bindings(const VKContext &context, VKBatch &batch)
Definition
vk_vertex_attribute_object.cc:89
blender::gpu::VKVertexAttributeObject::info
VkPipelineVertexInputStateCreateInfo info
Definition
vk_vertex_attribute_object.hh:34
blender::gpu::VKVertexAttributeObject::is_valid
bool is_valid
Definition
vk_vertex_attribute_object.hh:33
blender::gpu::VKVertexAttributeObject::bindings
Vector< VkVertexInputBindingDescription > bindings
Definition
vk_vertex_attribute_object.hh:37
blender::gpu::VKVertexAttributeObject::bind
void bind(render_graph::VKVertexBufferBindings &r_vertex_buffer_bindings) const
Definition
vk_vertex_attribute_object.cc:56
blender::gpu::VKVertexAttributeObject::vbos
Vector< VKVertexBuffer * > vbos
Definition
vk_vertex_attribute_object.hh:40
blender::gpu::VKVertexAttributeObject::clear
void clear()
Definition
vk_vertex_attribute_object.cc:23
blender::gpu::VKVertexBuffer
Definition
vk_vertex_buffer.hh:18
NULL
#define NULL
Definition
device/metal/compat.h:315
batch
struct @620::@622 batch
blender::gpu
Definition
blf_internal_types.hh:23
blender::gpu::AttributeMask
uint16_t AttributeMask
Definition
vk_vertex_attribute_object.hh:25
uint16_t
unsigned short uint16_t
Definition
stdint.h:79
int64_t
__int64 int64_t
Definition
stdint.h:89
GPUVertFormat
Definition
GPU_vertex_format.hh:73
blender::gpu::VKBufferWithOffset
Definition
vk_buffer.hh:97
blender::gpu::render_graph::VKVertexBufferBindings
Definition
vk_pipeline_data.hh:51
vk_buffer.hh
vk_common.hh
vk_render_graph.hh
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0