Blender V4.3
vk_index_buffer.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
11#include "GPU_index_buffer.hh"
12
13#include "vk_buffer.hh"
14
15namespace blender::gpu {
16
17class VKIndexBuffer : public IndexBuf {
18 VKBuffer buffer_;
19
20 public:
21 void upload_data() override;
22
23 void bind_as_ssbo(uint binding) override;
24
25 void read(uint32_t *data) const override;
26
27 void update_sub(uint start, uint len, const void *data) override;
28
29 VkBuffer vk_handle() const
30 {
31 return buffer_get().vk_handle();
32 }
33 VkIndexType vk_index_type() const
34 {
36 }
37
38 void ensure_updated();
39
40 private:
41 void strip_restart_indices() override;
42 void allocate();
43 VKBuffer &buffer_get();
44 const VKBuffer &buffer_get() const;
45};
46
47static inline VKIndexBuffer *unwrap(IndexBuf *index_buffer)
48{
49 return static_cast<VKIndexBuffer *>(index_buffer);
50}
51
52} // namespace blender::gpu
unsigned int uint
GPUIndexBufType index_type_
VkBuffer vk_handle() const
Definition vk_buffer.hh:69
void read(uint32_t *data) const override
VkIndexType vk_index_type() const
void update_sub(uint start, uint len, const void *data) override
void bind_as_ssbo(uint binding) override
int len
static Context * unwrap(GPUContext *ctx)
VkIndexType to_vk_index_type(const GPUIndexBufType index_type)
Definition vk_common.cc:839
unsigned int uint32_t
Definition stdint.h:80