Blender V4.3
vk_uniform_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 "BLI_utility_mixins.hh"
12
14
15#include "vk_buffer.hh"
16
17namespace blender::gpu {
18
20 VKBuffer buffer_;
21
22 public:
23 VKUniformBuffer(size_t size, const char *name) : UniformBuf(size, name) {}
24
25 void update(const void *data) override;
26 void clear_to_zero() override;
27 void bind(int slot) override;
28 void bind_as_ssbo(int slot) override;
29
33 void unbind() override;
34
35 VkBuffer vk_handle() const
36 {
37 return buffer_.vk_handle();
38 }
39
40 size_t size_in_bytes() const
41 {
42 return size_in_bytes_;
43 }
44
45 void ensure_updated();
46
47 private:
48 void allocate();
49};
50
52{
53 return static_cast<UniformBuf *>(uniform_buffer);
54}
55
56} // namespace blender::gpu
#define BLI_INLINE
VkBuffer vk_handle() const
Definition vk_buffer.hh:69
void bind_as_ssbo(int slot) override
void update(const void *data) override
VKUniformBuffer(size_t size, const char *name)
void bind(int slot) override
static GPUContext * wrap(Context *ctx)