|
Blender V5.3
|
#include "BLI_enum_flags.hh"#include "BLI_index_range.hh"#include "GPU_index_buffer.hh"#include "GPU_shader.hh"#include "GPU_storage_buffer.hh"#include "GPU_vertex_buffer.hh"Go to the source code of this file.
Namespaces | |
| namespace | blender |
| BMesh Iterators. | |
| namespace | blender::gpu |
Macros | |
| #define | GPU_BATCH_OWNS_NONE GPU_BATCH_INVALID |
Enumerations | |
| enum | blender::GPUBatchFlag { blender::GPU_BATCH_INVALID = 0 , blender::GPU_BATCH_OWNS_VBO = (1 << 0) , blender::GPU_BATCH_OWNS_VBO_MAX = (GPU_BATCH_OWNS_VBO << (GPU_BATCH_VBO_MAX_LEN - 1)) , blender::GPU_BATCH_OWNS_VBO_ANY = ((GPU_BATCH_OWNS_VBO << GPU_BATCH_VBO_MAX_LEN) - 1) , blender::GPU_BATCH_OWNS_INDEX = (GPU_BATCH_OWNS_VBO_MAX << 1) , blender::GPU_BATCH_INIT = (1 << 26) , blender::GPU_BATCH_BUILDING = (1 << 26) , blender::GPU_BATCH_DIRTY = (1 << 27) } |
Functions | |
| blender::BLI_STATIC_ASSERT (GPU_BATCH_OWNS_INDEX< GPU_BATCH_INIT, "GPUBatchFlag: Error: status flags are shadowed by the ownership bits!") namespace gpu | |
Buffers Management | |
| int | blender::GPU_batch_vertbuf_add (gpu::Batch *batch, gpu::VertBuf *vertex_buf, bool own_vbo) |
| void | blender::GPU_batch_elembuf_set (gpu::Batch *batch, gpu::IndexBuf *index_buf, bool own_ibo) |
| bool | blender::GPU_batch_vertbuf_has (const gpu::Batch *batch, const gpu::VertBuf *vertex_buf) |
Procedural drawing | |
A draw-call always need a batch to be issued. These are dummy batches that contains no vertex data and can be used to render geometry without per vertex inputs. | |
| gpu::Batch * | blender::GPU_batch_procedural_points_get () |
| gpu::Batch * | blender::GPU_batch_procedural_lines_get () |
| gpu::Batch * | blender::GPU_batch_procedural_triangles_get () |
| gpu::Batch * | blender::GPU_batch_procedural_triangle_strips_get () |
Module init/exit | |
| void | blender::gpu_batch_init () |
| void | blender::gpu_batch_exit () |
Variables | |
| static constexpr int | blender::GPU_BATCH_VBO_MAX_LEN = 16 |
| static constexpr int | blender::GPU_BATCH_VAO_STATIC_LEN = 3 |
| static constexpr int | blender::GPU_BATCH_VAO_DYN_ALLOC_COUNT = 16 |
Creation | |
| #define | GPU_batch_create(primitive_type, vertex_buf, index_buf) |
| #define | GPU_batch_init(batch, primitive_type, vertex_buf, index_buf) |
| gpu::Batch * | blender::GPU_batch_calloc () |
| gpu::Batch * | blender::GPU_batch_create_ex (GPUPrimType primitive_type, gpu::VertBuf *vertex_buf, gpu::IndexBuf *index_buf, GPUBatchFlag owns_flag) |
| gpu::Batch * | blender::GPU_batch_create_procedural (GPUPrimType primitive_type, int32_t vertex_count) |
| void | blender::GPU_batch_init_ex (gpu::Batch *batch, GPUPrimType primitive_type, gpu::VertBuf *vertex_buf, gpu::IndexBuf *index_buf, GPUBatchFlag owns_flag) |
| void | blender::GPU_batch_copy (gpu::Batch *batch_dst, gpu::Batch *batch_src) |
Deletion | |
| #define | GPU_BATCH_CLEAR_SAFE(batch) |
| #define | GPU_BATCH_DISCARD_SAFE(batch) |
| void | blender::GPU_batch_clear (gpu::Batch *batch) |
| void | blender::GPU_batch_zero (gpu::Batch *batch) |
| void | blender::GPU_batch_discard (gpu::Batch *batch) |
Shader Binding & Uniforms | |
| #define | GPU_batch_uniform_1i(batch, name, x) |
| #define | GPU_batch_uniform_1b(batch, name, x) |
| #define | GPU_batch_uniform_1f(batch, name, x) |
| #define | GPU_batch_uniform_2f(batch, name, x, y) |
| #define | GPU_batch_uniform_3f(batch, name, x, y, z) |
| #define | GPU_batch_uniform_4f(batch, name, x, y, z, w) |
| #define | GPU_batch_uniform_2fv(batch, name, val) |
| #define | GPU_batch_uniform_3fv(batch, name, val) |
| #define | GPU_batch_uniform_4fv(batch, name, val) |
| #define | GPU_batch_uniform_2fv_array(batch, name, len, val) |
| #define | GPU_batch_uniform_4fv_array(batch, name, len, val) |
| #define | GPU_batch_uniform_mat4(batch, name, val) |
| #define | GPU_batch_uniformbuf_bind(batch, name, ubo) |
| #define | GPU_batch_texture_bind(batch, name, tex) |
| void | blender::GPU_batch_set_shader (gpu::Batch *batch, gpu::Shader *shader, const gpu::shader::SpecializationConstants *constants_state=nullptr) |
| void | blender::GPU_batch_program_set_builtin (gpu::Batch *batch, GPUBuiltinShader shader_id) |
| void | blender::GPU_batch_program_set_builtin_with_config (gpu::Batch *batch, GPUBuiltinShader shader_id, GPUShaderConfig sh_cfg) |
| void | blender::GPU_batch_program_set_imm_shader (gpu::Batch *batch) |
| void | blender::GPU_batch_bind_as_resources (gpu::Batch *batch, gpu::Shader *shader, const gpu::shader::SpecializationConstants *constants=nullptr) |
| void | blender::GPU_batch_draw (gpu::Batch *batch) |
| void | blender::GPU_batch_draw_range (gpu::Batch *batch, int vertex_first, int vertex_count) |
| void | blender::GPU_batch_draw_instance_range (gpu::Batch *batch, int instance_first, int instance_count) |
| void | blender::GPU_batch_draw_advanced (gpu::Batch *batch, int vertex_first, int vertex_count, int instance_first, int instance_count) |
| void | blender::GPU_batch_draw_indirect (gpu::Batch *batch, gpu::StorageBuf *indirect_buf, intptr_t offset) |
| void | blender::GPU_batch_multi_draw_indirect (gpu::Batch *batch, gpu::StorageBuf *indirect_buf, int count, intptr_t offset, intptr_t stride) |
| void | blender::GPU_batch_draw_parameter_get (gpu::Batch *batch, int *r_vertex_count, int *r_vertex_first, int *r_base_index, int *r_instance_count) |
| IndexRange | blender::GPU_batch_draw_expanded_parameter_get (GPUPrimType input_prim_type, GPUPrimType output_prim_type, int vertex_count, int vertex_first, int output_primitive_cout) |
GPU geometry batch.
Contains Vertex Buffers, Index Buffers, and Shader reference, altogether representing a drawable entity. It is meant to be used for drawing large (> 1000 vertices) reusable (drawn multiple times) model with complex data layout. In other words, it is meant for all cases where the immediate drawing module (imm) is inadequate.
Vertex & Index Buffers can be owned by a batch. In such case they will be freed when the batch gets cleared or discarded.
Definition in file GPU_batch.hh.
| #define GPU_BATCH_CLEAR_SAFE | ( | batch | ) |
Definition at line 185 of file GPU_batch.hh.
Referenced by blender::draw::DRW_mesh_batch_cache_create_requested(), and blender::draw::mesh_batch_cache_check_vertex_group().
| #define GPU_batch_create | ( | primitive_type, | |
| vertex_buf, | |||
| index_buf ) |
Creates a #gpu::Batch without buffer ownership.
Definition at line 143 of file GPU_batch.hh.
Referenced by blender::draw::DRW_lattice_batch_cache_get_all_edges(), blender::draw::DRW_lattice_batch_cache_get_all_verts(), blender::draw::DRW_particles_batch_cache_get_dots(), blender::draw::DRW_particles_batch_cache_get_edit_inner_points(), blender::draw::DRW_particles_batch_cache_get_edit_strands(), blender::draw::DRW_particles_batch_cache_get_edit_tip_points(), blender::draw::DRW_particles_batch_cache_get_hair(), blender::draw::drw_volume_wireframe_cb(), blender::draw::pbvh::DrawCacheImpl::ensure_lines_batches(), blender::draw::pbvh::DrawCacheImpl::ensure_tris_batches(), blender::draw::grease_pencil_edit_batch_ensure(), blender::draw::grease_pencil_weight_batch_ensure(), blender::gpu::Context::procedural_lines_batch_get(), blender::gpu::Context::procedural_points_batch_get(), blender::gpu::Context::procedural_triangle_strips_batch_get(), blender::gpu::Context::procedural_triangles_batch_get(), blender::pygpu_batch__tp_new(), and blender::draw::overlay::ShapeCache::ShapeCache().
| #define GPU_BATCH_DISCARD_SAFE | ( | batch | ) |
Definition at line 199 of file GPU_batch.hh.
Referenced by blender::animviz_calc_motionpaths(), blender::blf_batch_draw_exit(), blender::draw::CurvesEvalCache::clear(), blender::draw::clear_edit_data(), blender::bke::motionpath::clear_preview_location(), blender::draw::curve_batch_cache_clear(), blender::draw::discard_buffers(), blender::draw::GSplatEvalCache::discard_buffers(), blender::draw::DRW_curve_batch_cache_dirty_tag(), blender::draw::DRW_lattice_batch_cache_dirty_tag(), blender::draw::DRW_particles_batch_cache_get_edit_strands(), blender::draw::pbvh::free_batches(), blender::bke::motionpath::free_cache(), blender::gpu::Context::free_resources(), blender::gizmo_button2d_free(), blender::draw::grease_pencil_batch_cache_clear(), blender::draw::lattice_batch_cache_clear(), blender::draw::mesh_batch_cache_clear(), blender::draw::particle_batch_cache_clear(), blender::draw::particle_batch_cache_clear_hair(), blender::draw::particle_batch_cache_clear_point(), blender::draw::pointcloud_batch_cache_clear(), blender::bke::motionpath::set_preview_location(), blender::draw::test_draw_curves_lib(), blender::draw::test_eevee_shadow_tag_update(), blender::draw::volume_batch_cache_clear(), blender::eevee::LookdevModule::~LookdevModule(), blender::workbench::SceneResources::~SceneResources(), blender::eevee::ShadowModule::~ShadowModule(), and blender::eevee::VolumeModule::~VolumeModule().
| #define GPU_batch_init | ( | batch, | |
| primitive_type, | |||
| vertex_buf, | |||
| index_buf ) |
Initialize a cleared #gpu::Batch without buffer ownership. A #gpu::Batch is in cleared state if it was just allocated using GPU_batch_calloc() or cleared using GPU_batch_clear().
Definition at line 161 of file GPU_batch.hh.
Referenced by blender::draw::DRW_mesh_batch_cache_create_requested().
| #define GPU_BATCH_OWNS_NONE GPU_BATCH_INVALID |
Definition at line 58 of file GPU_batch.hh.
| #define GPU_batch_texture_bind | ( | batch, | |
| name, | |||
| tex ) |
Definition at line 284 of file GPU_batch.hh.
Referenced by blender::blf_batch_draw().
| #define GPU_batch_uniform_1b | ( | batch, | |
| name, | |||
| x ) |
Definition at line 266 of file GPU_batch.hh.
| #define GPU_batch_uniform_1f | ( | batch, | |
| name, | |||
| x ) |
Definition at line 267 of file GPU_batch.hh.
Referenced by blender::button2d_draw_intern(), blender::ui::draw_dropshadow(), blender::draw_line_bounds(), blender::draw_line_loop(), blender::draw_line_pairs(), blender::ED_screen_draw_edges(), blender::knifetool_draw(), blender::ed::vse::sequencer_draw_scopes(), blender::ui::waveform_draw_one(), and blender::ui::waveform_draw_rgb().
| #define GPU_batch_uniform_1i | ( | batch, | |
| name, | |||
| x ) |
Set uniform variables for the shader currently bound to the #gpu::Batch.
Definition at line 265 of file GPU_batch.hh.
Referenced by blender::blf_batch_draw(), blender::ED_screen_draw_edges(), blender::gpu_viewport_draw_colormanaged(), and blender::ed::vse::sequencer_draw_scopes().
Definition at line 268 of file GPU_batch.hh.
| #define GPU_batch_uniform_2fv | ( | batch, | |
| name, | |||
| val ) |
Definition at line 273 of file GPU_batch.hh.
Referenced by blender::button2d_draw_intern(), blender::draw_line_bounds(), blender::draw_line_loop(), and blender::draw_line_pairs().
| #define GPU_batch_uniform_2fv_array | ( | batch, | |
| name, | |||
| len, | |||
| val ) |
Definition at line 276 of file GPU_batch.hh.
Definition at line 269 of file GPU_batch.hh.
| #define GPU_batch_uniform_3fv | ( | batch, | |
| name, | |||
| val ) |
Definition at line 274 of file GPU_batch.hh.
Referenced by blender::curve_draw_stroke_3d(), blender::ed::curves::curve_draw_stroke_3d(), blender::ui::draw_widgetbase_batch(), and blender::ui::widgetbase_draw_cache_flush().
| #define GPU_batch_uniform_4fv | ( | batch, | |
| name, | |||
| val ) |
Definition at line 275 of file GPU_batch.hh.
Referenced by blender::gpu::tests::blend_test(), blender::draw_line_bounds(), blender::draw_line_loop(), blender::draw_line_pairs(), blender::drawscredge_area(), blender::ED_screen_draw_edges(), blender::knifetool_draw(), blender::stitch_draw_vbo(), blender::wm_gizmo_geometryinfo_draw(), blender::WM_window_csd_draw_corner_mask(), blender::wm_xr_controller_model_draw(), and blender::wm_xr_navigation_teleport_draw_destination().
| #define GPU_batch_uniform_4fv_array | ( | batch, | |
| name, | |||
| len, | |||
| val ) |
Definition at line 278 of file GPU_batch.hh.
Referenced by blender::ui::draw_dropshadow(), blender::ed::space_node::draw_node_socket_batch(), blender::ui::draw_roundbox_4fv_ex(), blender::ui::draw_widgetbase_batch(), blender::ed::space_node::nodesocket_cache_flush(), and blender::ui::widgetbase_draw_cache_flush().
| #define GPU_batch_uniform_mat4 | ( | batch, | |
| name, | |||
| val ) |
Definition at line 280 of file GPU_batch.hh.
| #define GPU_batch_uniformbuf_bind | ( | batch, | |
| name, | |||
| ubo ) |
Definition at line 282 of file GPU_batch.hh.
Referenced by blender::ui::draw_but_UNITVEC(), and blender::ed::space_node::nodelink_batch_draw().