Blender V4.3
gl_uniform_buffer.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2020 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11#include "MEM_guardedalloc.h"
12
14
15namespace blender {
16namespace gpu {
17
21class GLUniformBuf : public UniformBuf {
22 private:
24 int slot_ = -1;
26 GLuint ubo_id_ = 0;
27
28 public:
29 GLUniformBuf(size_t size, const char *name);
31
32 void update(const void *data) override;
33 void clear_to_zero() override;
34 void bind(int slot) override;
35 void bind_as_ssbo(int slot) override;
36 void unbind() override;
37
38 private:
39 void init();
40
41 MEM_CXX_CLASS_ALLOC_FUNCS("GLUniformBuf");
42};
43
44} // namespace gpu
45} // namespace blender
Read Guarded memory(de)allocation.
GLUniformBuf(size_t size, const char *name)
void update(const void *data) override
void bind(int slot) override
void bind_as_ssbo(int slot) override