Blender V4.3
GPU_uniform_buffer.hh File Reference

Go to the source code of this file.

Macros

#define GPU_uniformbuf_create(size)   GPU_uniformbuf_create_ex(size, nullptr, __func__);
 
#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_NODE_TREE_UBO_SLOT   0
 

Functions

GPUUniformBuf * GPU_uniformbuf_create_ex (size_t size, const void *data, const char *name)
 
GPUUniformBuf * GPU_uniformbuf_create_from_list (ListBase *inputs, const char *name)
 
void GPU_uniformbuf_free (GPUUniformBuf *ubo)
 
void GPU_uniformbuf_update (GPUUniformBuf *ubo, const void *data)
 
void GPU_uniformbuf_bind (GPUUniformBuf *ubo, int slot)
 
void GPU_uniformbuf_bind_as_ssbo (GPUUniformBuf *ubo, int slot)
 
void GPU_uniformbuf_unbind (GPUUniformBuf *ubo)
 
void GPU_uniformbuf_debug_unbind_all ()
 
void GPU_uniformbuf_clear_to_zero (GPUUniformBuf *ubo)
 

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

◆ GPU_LAYER_ATTRIBUTE_UBO_BLOCK_NAME

#define GPU_LAYER_ATTRIBUTE_UBO_BLOCK_NAME   "drw_layer_attrs"

Definition at line 51 of file GPU_uniform_buffer.hh.

Referenced by DRW_shgroup_add_material_resources().

◆ GPU_NODE_TREE_UBO_SLOT

◆ GPU_UBO_BLOCK_NAME

#define GPU_UBO_BLOCK_NAME   "node_tree"

◆ GPU_uniformbuf_create

Function Documentation

◆ GPU_uniformbuf_bind()

◆ GPU_uniformbuf_bind_as_ssbo()

void GPU_uniformbuf_bind_as_ssbo ( GPUUniformBuf * ubo,
int slot )

◆ GPU_uniformbuf_clear_to_zero()

void GPU_uniformbuf_clear_to_zero ( GPUUniformBuf * ubo)

Definition at line 249 of file gpu_uniform_buffer.cc.

References blender::gpu::unwrap().

Referenced by blender::eevee::ShadowModule::set_view().

◆ GPU_uniformbuf_create_ex()

◆ GPU_uniformbuf_create_from_list()

GPUUniformBuf * GPU_uniformbuf_create_from_list ( ListBase * inputs,
const char * name )

◆ 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 244 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(), draw_shgroup(), DRW_state_reset(), and blender::realtime_compositor::ShaderOperation::execute().

◆ GPU_uniformbuf_free()

◆ GPU_uniformbuf_unbind()

◆ GPU_uniformbuf_update()