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

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.
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

void blender::GPU_uniformbuf_inputs_sort (ListBaseT< LinkData > *inputs)
C-API
gpu::UniformBuf * blender::GPU_uniformbuf_create_ex (size_t size, const void *data, const char *name)
gpu::UniformBuf * blender::GPU_uniformbuf_create_from_list (ListBaseT< LinkData > *inputs, const char *name)
void blender::GPU_uniformbuf_free (gpu::UniformBuf *ubo)
void blender::GPU_uniformbuf_update (gpu::UniformBuf *ubo, const void *data)
void blender::GPU_uniformbuf_bind (gpu::UniformBuf *ubo, int slot)
void blender::GPU_uniformbuf_bind_as_ssbo (gpu::UniformBuf *ubo, int slot)
void blender::GPU_uniformbuf_unbind (gpu::UniformBuf *ubo)
void blender::GPU_uniformbuf_debug_unbind_all ()
void blender::GPU_uniformbuf_clear_to_zero (gpu::UniformBuf *ubo)

Variables

static constexpr int blender::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 61 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 64 of file GPU_uniform_buffer.hh.

Referenced by blender::draw::GSplatEvalCache::discard_buffers(), and blender::draw::GSplatModule::~GSplatModule().

◆ GPU_uniformbuf_create