Blender
V3.3
|
Go to the source code of this file.
Macros | |
#define | GPU_uniformbuf_create(size) GPU_uniformbuf_create_ex(size, NULL, __func__); |
#define | GPU_UBO_BLOCK_NAME "node_tree" |
#define | GPU_ATTRIBUTE_UBO_BLOCK_NAME "unf_attrs" |
Typedefs | |
typedef struct GPUUniformBuf | GPUUniformBuf |
Functions | |
GPUUniformBuf * | GPU_uniformbuf_create_ex (size_t size, const void *data, const char *name) |
GPUUniformBuf * | GPU_uniformbuf_create_from_list (struct 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_unbind (GPUUniformBuf *ubo) |
void | GPU_uniformbuf_unbind_all (void) |
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.h.
#define GPU_ATTRIBUTE_UBO_BLOCK_NAME "unf_attrs" |
Definition at line 46 of file GPU_uniform_buffer.h.
#define GPU_UBO_BLOCK_NAME "node_tree" |
Definition at line 45 of file GPU_uniform_buffer.h.
#define GPU_uniformbuf_create | ( | size | ) | GPU_uniformbuf_create_ex(size, NULL, __func__); |
Definition at line 35 of file GPU_uniform_buffer.h.
typedef struct GPUUniformBuf GPUUniformBuf |
Opaque type hiding blender::gpu::UniformBuf.
Definition at line 1 of file GPU_uniform_buffer.h.
void GPU_uniformbuf_bind | ( | GPUUniformBuf * | ubo, |
int | slot | ||
) |
Definition at line 216 of file gpu_uniform_buffer.cc.
References blender::gpu::unwrap().
Referenced by draw_call_resource_bind(), draw_subdiv_ubo_update_and_bind(), draw_update_uniforms(), DRW_sparse_uniform_buffer_bind(), icon_draw_cache_texture_flush_ex(), immBindUniformBuf(), and pygpu_shader_uniform_block().
GPUUniformBuf* GPU_uniformbuf_create_ex | ( | size_t | size, |
const void * | data, | ||
const char * | name | ||
) |
Definition at line 178 of file gpu_uniform_buffer.cc.
References data, blender::gpu::GPUBackend::get(), size(), blender::gpu::GPUBackend::uniformbuf_alloc(), blender::gpu::UniformBuf::update(), and blender::gpu::wrap().
Referenced by createGPUShader(), draw_subdiv_ubo_update_and_bind(), DRW_draw_depth_object(), DRW_globals_update(), drw_manager_init(), EEVEE_materials_init(), EEVEE_shadows_init(), gpencil_draw_stroke_3d(), icon_draw_cache_texture_flush_ex(), blender::ed::space_node::node_draw_link_bezier(), blender::ed::space_node::nodelink_batch_draw(), pygpu_uniformbuffer__tp_new(), ui_draw_but_UNITVEC(), blender::draw::detail::UniformCommon< T, len, device_only >::UniformCommon(), workbench_cavity_samples_ubo_ensure(), and workbench_view_layer_data_ensure_ex().
GPUUniformBuf* GPU_uniformbuf_create_from_list | ( | struct ListBase * | inputs, |
const char * | name | ||
) |
Create UBO from inputs list. Return NULL if failed to create or if
inputs | is empty. |
inputs | ListBase of BLI_genericNodeN(GPUInput). |
Definition at line 188 of file gpu_uniform_buffer.cc.
References blender::gpu::UniformBuf::attach_data(), BLI_listbase_is_empty(), buffer_fill_from_list(), buffer_from_list_inputs_sort(), buffer_size_from_list(), data, blender::gpu::GPUBackend::get(), inputs, MEM_mallocN, blender::gpu::GPUBackend::uniformbuf_alloc(), and blender::gpu::wrap().
Referenced by GPU_material_uniform_buffer_create().
void GPU_uniformbuf_free | ( | GPUUniformBuf * | ubo | ) |
Definition at line 206 of file gpu_uniform_buffer.cc.
References blender::gpu::unwrap().
Referenced by BPyGPUUniformBuf__tp_dealloc(), draw_subdiv_cache_free(), DRW_draw_depth_object(), drw_resource_buffer_finish(), DRW_sparse_uniform_buffer_clear(), DRW_viewport_data_free(), gpencil_draw_stroke_3d(), gpu_material_free_single(), icon_draw_cache_texture_flush_ex(), blender::ed::space_node::node_draw_link_bezier(), blender::ed::space_node::nodelink_batch_draw(), ui_draw_but_UNITVEC(), OCIO_GPUCurveMappping::~OCIO_GPUCurveMappping(), OCIO_GPUShader::~OCIO_GPUShader(), OCIO_GPUTextures::~OCIO_GPUTextures(), and blender::draw::detail::UniformCommon< T, len, device_only >::~UniformCommon().
void GPU_uniformbuf_unbind | ( | GPUUniformBuf * | ubo | ) |
Definition at line 221 of file gpu_uniform_buffer.cc.
References blender::gpu::unwrap().
Referenced by draw_call_batching_finish(), draw_call_resource_bind(), DRW_sparse_uniform_buffer_unbind(), icon_draw_cache_texture_flush_ex(), blender::ed::space_node::node_draw_link_bezier(), and blender::ed::space_node::nodelink_batch_draw().
Definition at line 226 of file gpu_uniform_buffer.cc.
Referenced by draw_shgroup(), and DRW_state_reset().
void GPU_uniformbuf_update | ( | GPUUniformBuf * | ubo, |
const void * | data | ||
) |
Definition at line 211 of file gpu_uniform_buffer.cc.
References data, and blender::gpu::unwrap().
Referenced by draw_subdiv_ubo_update_and_bind(), DRW_globals_update(), drw_resource_buffer_finish(), DRW_sparse_uniform_buffer_flush(), drw_update_view(), eevee_draw_scene(), eevee_lightbake_render_grid_sample(), eevee_lightbake_render_probe_sample(), eevee_lightbake_render_world_sample(), EEVEE_lightbake_update_world_quick(), EEVEE_lightprobes_cache_finish(), EEVEE_lightprobes_refresh_planar(), EEVEE_lights_cache_finish(), EEVEE_lookdev_draw(), EEVEE_material_output_accumulate(), EEVEE_materials_init(), EEVEE_render_draw(), EEVEE_shadows_draw(), GPENCIL_cache_finish(), GPU_material_sss_profile_get(), OVERLAY_grid_cache_init(), blender::draw::detail::UniformCommon< T, len, device_only >::push_update(), pygpu_uniformbuffer_update(), updateGPUCurveMapping(), updateGPUDisplayParameters(), workbench_dof_setup_samples(), workbench_update_material_ubos(), and workbench_update_world_ubo().