Blender V4.5
GPU_uniform_buffer.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2005 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
15
16#pragma once
17
18#include "BLI_sys_types.h"
19
20struct ListBase;
21
23struct GPUUniformBuf;
24
25GPUUniformBuf *GPU_uniformbuf_create_ex(size_t size, const void *data, const char *name);
32GPUUniformBuf *GPU_uniformbuf_create_from_list(ListBase *inputs, const char *name);
33
34#define GPU_uniformbuf_create(size) GPU_uniformbuf_create_ex(size, nullptr, __func__);
35
36void GPU_uniformbuf_free(GPUUniformBuf *ubo);
37
38void GPU_uniformbuf_update(GPUUniformBuf *ubo, const void *data);
39
40void GPU_uniformbuf_bind(GPUUniformBuf *ubo, int slot);
41void GPU_uniformbuf_bind_as_ssbo(GPUUniformBuf *ubo, int slot);
42void GPU_uniformbuf_unbind(GPUUniformBuf *ubo);
48
49void GPU_uniformbuf_clear_to_zero(GPUUniformBuf *ubo);
50
51#define GPU_UBO_BLOCK_NAME "node_tree"
52#define GPU_ATTRIBUTE_UBO_BLOCK_NAME "unf_attrs"
53#define GPU_LAYER_ATTRIBUTE_UBO_BLOCK_NAME "drw_layer_attrs"
54constexpr static int GPU_NODE_TREE_UBO_SLOT = 0;
55
56#define GPU_UBO_FREE_SAFE(ubo) \
57 do { \
58 if (ubo != nullptr) { \
59 GPU_uniformbuf_free(ubo); \
60 ubo = nullptr; \
61 } \
62 } while (0)
GPUUniformBuf * GPU_uniformbuf_create_ex(size_t size, const void *data, const char *name)
void GPU_uniformbuf_unbind(GPUUniformBuf *ubo)
void GPU_uniformbuf_update(GPUUniformBuf *ubo, const void *data)
void GPU_uniformbuf_free(GPUUniformBuf *ubo)
GPUUniformBuf * GPU_uniformbuf_create_from_list(ListBase *inputs, const char *name)
static constexpr int GPU_NODE_TREE_UBO_SLOT
void GPU_uniformbuf_clear_to_zero(GPUUniformBuf *ubo)
void GPU_uniformbuf_debug_unbind_all()
void GPU_uniformbuf_bind_as_ssbo(GPUUniformBuf *ubo, int slot)
void GPU_uniformbuf_bind(GPUUniformBuf *ubo, int slot)
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
static blender::bke::bNodeSocketTemplate inputs[]