Blender V5.0
GPU_uniform_buffer.hh File Reference
#include "BLI_sys_types.h"

Go to the source code of this file.

Namespaces

namespace  blender
namespace  blender::gpu

Macros

#define GPU_uniformbuf_create(size)
#define GPU_UBO_BLOCK_NAME   "node_tree"
#define GPU_ATTRIBUTE_UBO_BLOCK_NAME   "unf_attrs"
#define GPU_LAYER_ATTRIBUTE_UBO_BLOCK_NAME   "drw_layer_attrs"
#define GPU_UBO_FREE_SAFE(ubo)

Functions

blender::gpu::UniformBufGPU_uniformbuf_create_ex (size_t size, const void *data, const char *name)
blender::gpu::UniformBufGPU_uniformbuf_create_from_list (ListBase *inputs, const char *name)
void GPU_uniformbuf_free (blender::gpu::UniformBuf *ubo)
void GPU_uniformbuf_update (blender::gpu::UniformBuf *ubo, const void *data)
void GPU_uniformbuf_bind (blender::gpu::UniformBuf *ubo, int slot)
void GPU_uniformbuf_bind_as_ssbo (blender::gpu::UniformBuf *ubo, int slot)
void GPU_uniformbuf_unbind (blender::gpu::UniformBuf *ubo)
void GPU_uniformbuf_debug_unbind_all ()
void GPU_uniformbuf_clear_to_zero (blender::gpu::UniformBuf *ubo)

Variables

static constexpr int GPU_NODE_TREE_UBO_SLOT = 0

Detailed Description

Uniform buffers API. Used to handle many uniforms update at once. Make sure that the data structure is compatible with what the implementation expect. (see "7.6.2.2 Standard Uniform Block Layout" from the OpenGL spec for more info about std140 layout) Rule of thumb: Padding to 16bytes, don't use vec3, don't use arrays of anything that is not vec4 aligned.

Definition in file GPU_uniform_buffer.hh.

Macro Definition Documentation

◆ GPU_ATTRIBUTE_UBO_BLOCK_NAME

#define GPU_ATTRIBUTE_UBO_BLOCK_NAME   "unf_attrs"

◆ GPU_LAYER_ATTRIBUTE_UBO_BLOCK_NAME

#define GPU_LAYER_ATTRIBUTE_UBO_BLOCK_NAME   "drw_layer_attrs"

Definition at line 56 of file GPU_uniform_buffer.hh.

◆ GPU_UBO_BLOCK_NAME

#define GPU_UBO_BLOCK_NAME   "node_tree"

◆ GPU_UBO_FREE_SAFE

#define GPU_UBO_FREE_SAFE ( ubo)
Value:
do { \
if (ubo != nullptr) { \
GPU_uniformbuf_free(ubo); \
ubo = nullptr; \
} \
} while (0)

Definition at line 59 of file GPU_uniform_buffer.hh.

◆ GPU_uniformbuf_create

#define GPU_uniformbuf_create ( size)
Value:
GPU_uniformbuf_create_ex(size, nullptr, __func__);
blender::gpu::UniformBuf * GPU_uniformbuf_create_ex(size_t size, const void *data, const char *name)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52

Definition at line 37 of file GPU_uniform_buffer.hh.

Referenced by blender::draw::gpencil::gpencil_light_pool_add(), blender::draw::gpencil::gpencil_material_pool_add(), blender::ocio::internal::GPUCurveMappping::initialize_common(), blender::ed::vse::StripsDrawBatch::StripsDrawBatch(), and blender::ed::vse::ThumbsDrawBatch::ThumbsDrawBatch().

Function Documentation

◆ GPU_uniformbuf_bind()

◆ GPU_uniformbuf_bind_as_ssbo()

◆ GPU_uniformbuf_clear_to_zero()

void GPU_uniformbuf_clear_to_zero ( blender::gpu::UniformBuf * ubo)

◆ GPU_uniformbuf_create_ex()

◆ GPU_uniformbuf_create_from_list()

◆ GPU_uniformbuf_debug_unbind_all()

void GPU_uniformbuf_debug_unbind_all ( )

Resets the internal slot usage tracking. But there is no guarantee that this actually undo the bindings for the next draw call. Only has effect when G_DEBUG_GPU is set.

Definition at line 257 of file gpu_uniform_buffer.cc.

References blender::gpu::Context::debug_unbind_all_ubo(), and blender::gpu::Context::get().

Referenced by blender::draw::command::RecordingState::cleanup(), blender::compositor::ShaderOperation::execute(), and blender::draw::command::StateSet::set().

◆ GPU_uniformbuf_free()

◆ GPU_uniformbuf_unbind()

◆ GPU_uniformbuf_update()

Variable Documentation

◆ GPU_NODE_TREE_UBO_SLOT

int GPU_NODE_TREE_UBO_SLOT = 0
staticconstexpr