|
Blender V5.0
|
#include "BLI_index_range.hh"#include "BLI_utildefines.h"#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 |
| namespace | blender::gpu |
Macros | |
| #define | GPU_BATCH_OWNS_NONE GPU_BATCH_INVALID |
Enumerations | |
| enum | GPUBatchFlag { GPU_BATCH_INVALID = 0 , GPU_BATCH_OWNS_VBO = (1 << 0) , GPU_BATCH_OWNS_VBO_MAX = (GPU_BATCH_OWNS_VBO << (GPU_BATCH_VBO_MAX_LEN - 1)) , GPU_BATCH_OWNS_VBO_ANY = ((GPU_BATCH_OWNS_VBO << GPU_BATCH_VBO_MAX_LEN) - 1) , GPU_BATCH_OWNS_INDEX = (GPU_BATCH_OWNS_VBO_MAX << 1) , GPU_BATCH_INIT = (1 << 26) , GPU_BATCH_BUILDING = (1 << 26) , GPU_BATCH_DIRTY = (1 << 27) } |
Functions | |
Buffers Management | |
| int | GPU_batch_vertbuf_add (blender::gpu::Batch *batch, blender::gpu::VertBuf *vertex_buf, bool own_vbo) |
| void | GPU_batch_elembuf_set (blender::gpu::Batch *batch, blender::gpu::IndexBuf *index_buf, bool own_ibo) |
| bool | GPU_batch_vertbuf_has (const blender::gpu::Batch *batch, const blender::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. | |
| blender::gpu::Batch * | GPU_batch_procedural_points_get () |
| blender::gpu::Batch * | GPU_batch_procedural_lines_get () |
| blender::gpu::Batch * | GPU_batch_procedural_triangles_get () |
| blender::gpu::Batch * | GPU_batch_procedural_triangle_strips_get () |
Module init/exit | |
| void | gpu_batch_init () |
| void | gpu_batch_exit () |
Variables | |
| static constexpr int | GPU_BATCH_VBO_MAX_LEN = 16 |
| static constexpr int | GPU_BATCH_VAO_STATIC_LEN = 3 |
| static constexpr int | 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) |
| blender::gpu::Batch * | GPU_batch_create_ex (GPUPrimType primitive_type, blender::gpu::VertBuf *vertex_buf, blender::gpu::IndexBuf *index_buf, GPUBatchFlag owns_flag) |
| blender::gpu::Batch * | GPU_batch_create_procedural (GPUPrimType primitive_type, int32_t vertex_count) |
| void | GPU_batch_init_ex (blender::gpu::Batch *batch, GPUPrimType primitive_type, blender::gpu::VertBuf *vertex_buf, blender::gpu::IndexBuf *index_buf, GPUBatchFlag owns_flag) |
| void | GPU_batch_copy (blender::gpu::Batch *batch_dst, blender::gpu::Batch *batch_src) |
Deletion | |
| #define | GPU_BATCH_CLEAR_SAFE(batch) |
| #define | GPU_BATCH_DISCARD_SAFE(batch) |
| void | GPU_batch_clear (blender::gpu::Batch *batch) |
| void | GPU_batch_zero (blender::gpu::Batch *batch) |
| void | GPU_batch_discard (blender::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 | GPU_batch_set_shader (blender::gpu::Batch *batch, blender::gpu::Shader *shader, const blender::gpu::shader::SpecializationConstants *constants_state=nullptr) |
| void | GPU_batch_program_set_builtin (blender::gpu::Batch *batch, GPUBuiltinShader shader_id) |
| void | GPU_batch_program_set_builtin_with_config (blender::gpu::Batch *batch, GPUBuiltinShader shader_id, GPUShaderConfig sh_cfg) |
| void | GPU_batch_program_set_imm_shader (blender::gpu::Batch *batch) |
| void | GPU_batch_bind_as_resources (blender::gpu::Batch *batch, blender::gpu::Shader *shader, const blender::gpu::shader::SpecializationConstants *constants=nullptr) |
| void | GPU_batch_draw (blender::gpu::Batch *batch) |
| void | GPU_batch_draw_range (blender::gpu::Batch *batch, int vertex_first, int vertex_count) |
| void | GPU_batch_draw_instance_range (blender::gpu::Batch *batch, int instance_first, int instance_count) |
| void | GPU_batch_draw_advanced (blender::gpu::Batch *batch, int vertex_first, int vertex_count, int instance_first, int instance_count) |
| void | GPU_batch_draw_indirect (blender::gpu::Batch *batch, blender::gpu::StorageBuf *indirect_buf, intptr_t offset) |
| void | GPU_batch_multi_draw_indirect (blender::gpu::Batch *batch, blender::gpu::StorageBuf *indirect_buf, int count, intptr_t offset, intptr_t stride) |
| void | GPU_batch_draw_parameter_get (blender::gpu::Batch *batch, int *r_vertex_count, int *r_vertex_first, int *r_base_index, int *r_instance_count) |
| blender::IndexRange | 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 183 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 #blender::gpu::Batch without buffer ownership.
Definition at line 141 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_geom_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(), pygpu_batch__tp_new(), and blender::draw::overlay::ShapeCache::ShapeCache().
| #define GPU_BATCH_DISCARD_SAFE | ( | batch | ) |
Definition at line 197 of file GPU_batch.hh.
Referenced by animviz_calc_motionpaths(), animviz_free_motionpath_cache(), blf_batch_draw_exit(), blender::draw::CurvesEvalCache::clear(), blender::draw::clear_edit_data(), blender::draw::curve_batch_cache_clear(), blender::draw::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::gpu::Context::free_resources(), gizmo_button2d_free(), blender::draw::grease_pencil_batch_cache_clear(), blender::draw::lattice_batch_cache_clear(), blender::draw::mesh_batch_cache_clear(), motionpaths_calc_bake_targets(), 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::draw::test_draw_curves_lib(), 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 #blender::gpu::Batch without buffer ownership. A #blender::gpu::Batch is in cleared state if it was just allocated using GPU_batch_calloc() or cleared using GPU_batch_clear().
Definition at line 159 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 56 of file GPU_batch.hh.
Definition at line 288 of file GPU_batch.hh.
Referenced by blf_batch_draw().
Definition at line 270 of file GPU_batch.hh.
Definition at line 271 of file GPU_batch.hh.
Referenced by button2d_draw_intern(), draw_line_bounds(), draw_line_loop(), draw_line_pairs(), ED_screen_draw_edges(), knifetool_draw(), blender::ed::vse::sequencer_draw_scopes(), ui_draw_dropshadow(), waveform_draw_one(), waveform_draw_rgb(), and wm_xr_raycast_draw().
Set uniform variables for the shader currently bound to the #blender::gpu::Batch.
Definition at line 269 of file GPU_batch.hh.
Referenced by blf_batch_draw(), ED_screen_draw_edges(), gpu_viewport_draw_colormanaged(), blender::ed::vse::sequencer_draw_scopes(), and wm_xr_raycast_draw().
Definition at line 272 of file GPU_batch.hh.
Definition at line 277 of file GPU_batch.hh.
Referenced by button2d_draw_intern(), draw_line_bounds(), draw_line_loop(), and draw_line_pairs().
Definition at line 280 of file GPU_batch.hh.
Definition at line 273 of file GPU_batch.hh.
Definition at line 278 of file GPU_batch.hh.
Referenced by blender::ed::curves::curve_draw_stroke_3d(), curve_draw_stroke_3d(), draw_widgetbase_batch(), UI_widgetbase_draw_cache_flush(), and wm_xr_raycast_draw().
Definition at line 275 of file GPU_batch.hh.
Referenced by waveform_draw_one().
Definition at line 279 of file GPU_batch.hh.
Referenced by blender::gpu::tests::blend_test(), draw_line_bounds(), draw_line_loop(), draw_line_pairs(), drawscredge_area(), ED_screen_draw_edges(), knifetool_draw(), stitch_draw_vbo(), wm_gizmo_geometryinfo_draw(), wm_xr_controller_model_draw(), wm_xr_raycast_destination_draw(), and wm_xr_raycast_draw().
Definition at line 282 of file GPU_batch.hh.
Referenced by blender::ed::space_node::draw_node_socket_batch(), draw_widgetbase_batch(), blender::ed::space_node::nodesocket_cache_flush(), ui_draw_dropshadow(), UI_draw_roundbox_4fv_ex(), UI_widgetbase_draw_cache_flush(), and wm_xr_raycast_draw().
Definition at line 284 of file GPU_batch.hh.
Definition at line 286 of file GPU_batch.hh.
Referenced by blender::ed::space_node::nodelink_batch_draw(), and ui_draw_but_UNITVEC().
| enum GPUBatchFlag |
| Enumerator | |
|---|---|
| GPU_BATCH_INVALID | Invalid default state. |
| GPU_BATCH_OWNS_VBO | blender::gpu::VertBuf ownership. (One bit per vbo) |
| GPU_BATCH_OWNS_VBO_MAX | |
| GPU_BATCH_OWNS_VBO_ANY | |
| GPU_BATCH_OWNS_INDEX | blender::gpu::IndexBuf ownership. |
| GPU_BATCH_INIT | Has been initialized. At least one VBO is set. |
| GPU_BATCH_BUILDING | Batch is initialized but its VBOs are still being populated. (optional) |
| GPU_BATCH_DIRTY | Cached data need to be rebuild. (VAO, PSO, ...) |
Definition at line 37 of file GPU_batch.hh.
| void GPU_batch_bind_as_resources | ( | blender::gpu::Batch * | batch, |
| blender::gpu::Shader * | shader, | ||
| const blender::gpu::shader::SpecializationConstants * | constants = nullptr ) |
Bind vertex and index buffers to SSBOs using Frequency::GEOMETRY.
References batch.
Referenced by blender::ed::greasepencil::image_render::draw_grease_pencil_stroke(), blender::draw::command::Draw::execute(), and blender::draw::command::DrawMulti::execute().
| void GPU_batch_clear | ( | blender::gpu::Batch * | batch | ) |
Clear a #blender::gpu::Batch without freeing its own memory. The #blender::gpu::Batch can then be reused using GPU_batch_init(). Discards all owned vertex and index buffers.
References batch.
| void GPU_batch_copy | ( | blender::gpu::Batch * | batch_dst, |
| blender::gpu::Batch * | batch_src ) |
DEPRECATED: It is easy to loose ownership with this. To be removed. This will share the VBOs with the new batch.
| blender::gpu::Batch * GPU_batch_create_ex | ( | GPUPrimType | primitive_type, |
| blender::gpu::VertBuf * | vertex_buf, | ||
| blender::gpu::IndexBuf * | index_buf, | ||
| GPUBatchFlag | owns_flag ) |
Allocate a #blender::gpu::Batch with a cleared state. The returned #blender::gpu::Batch needs to be passed to GPU_batch_init before being usable. Creates a #blender::gpu::Batch with explicit buffer ownership.
Definition at line 51 of file gpu_batch.cc.
References batch, GPU_batch_calloc(), and GPU_batch_init_ex().
Referenced by batch_screen_edges_get(), batch_sphere_wire(), circle_draw_rgb(), blender::ed::greasepencil::image_render::draw_grease_pencil_stroke(), draw_line_bounds(), draw_line_loop(), draw_line_pairs(), blender::render::hydra::DrawTexture::DrawTexture(), blender::draw::drw_volume_selection_surface_cb(), blender::draw::drw_volume_wireframe_cb(), GPU_batch_preset_quad(), gpu_batch_sphere(), GPU_batch_tris_from_poly_2d_encoded(), GPU_batch_unit_cube(), GPU_batch_wire_from_poly_2d_encoded(), gpu_viewport_batch_create(), immBeginBatch(), knifetool_draw(), blender::draw::lattice_batch_cache_create_overlay_batches(), blender::ed::space_node::nodelink_batch_init(), blender::ed::space_node::nodesocket_batch_init(), blender::ed::vse::SeqQuadsBatch::SeqQuadsBatch(), blender::draw::overlay::ShapeCache::ShapeCache(), stitch_draw_vbo(), ui_batch_roundbox_shadow_get(), ui_batch_roundbox_widget_get(), blender::gpu::tests::vertex_buffer_fetch_mode(), waveform_draw_one(), waveform_draw_rgb(), wm_gizmo_geometryinfo_draw(), and wm_xr_controller_model_batch_create().
| blender::gpu::Batch * GPU_batch_create_procedural | ( | GPUPrimType | primitive_type, |
| int32_t | vertex_count ) |
Definition at line 83 of file gpu_batch.cc.
References batch, BLI_assert, GPU_batch_calloc(), GPU_BATCH_DIRTY, GPU_BATCH_INIT, and v.
Referenced by blender::draw::CurvesEvalCache::batch_get(), blf_batch_draw_init(), blender::gpu::tests::gpu_shader_lib_test(), blender::ed::vse::sequencer_draw_scopes(), blender::draw::test_draw_curves_lib(), blender::gpu::tests::test_framebuffer_multi_viewport(), blender::gpu::tests::test_framebuffer_subpass_input(), blender::gpu::tests::ShaderSpecializationConst::validate(), and wm_xr_raycast_update().
| void GPU_batch_discard | ( | blender::gpu::Batch * | batch | ) |
Free a #blender::gpu::Batch object. Discards all owned vertex and index buffers.
References batch.
Referenced by circle_draw_rgb(), blender::ed::greasepencil::image_render::draw_grease_pencil_stroke(), draw_line_bounds(), draw_line_loop(), draw_line_pairs(), gpu_batch_presets_exit(), blender::gpu::tests::gpu_shader_lib_test(), gpu_viewport_batch_free(), gpu_viewport_batch_get(), knifetool_draw(), pygpu_batch__tp_dealloc(), blender::ed::vse::sequencer_draw_scopes(), stitch_draw_vbo(), blender::gpu::tests::test_framebuffer_multi_viewport(), blender::gpu::tests::test_framebuffer_subpass_input(), blender::gpu::tests::ShaderSpecializationConst::validate(), blender::gpu::tests::vertex_buffer_fetch_mode(), waveform_draw_one(), waveform_draw_rgb(), wm_gizmo_geometryinfo_draw(), wm_xr_session_controller_data_free(), wm_xr_session_raycast_model_free(), blender::render::hydra::DrawTexture::~DrawTexture(), blender::ed::vse::SeqQuadsBatch::~SeqQuadsBatch(), and blender::image_engine::TextureInfo::~TextureInfo().
| void GPU_batch_draw | ( | blender::gpu::Batch * | batch | ) |
Draw the #blender::gpu::Batch with vertex count and instance count from its vertex buffers lengths. Ensures the associated shader is bound. TODO(fclem) remove this behavior.
References batch.
Referenced by blender::gpu::tests::blend_test(), button2d_draw_intern(), circle_draw_rgb(), blender::ed::curves::curve_draw_stroke_3d(), curve_draw_stroke_3d(), blender::render::hydra::DrawTexture::draw(), draw_line_bounds(), draw_line_loop(), draw_line_pairs(), blender::ed::space_node::draw_node_socket_batch(), draw_widgetbase_batch(), drawscredge_area(), blender::gpu::tests::gpu_shader_lib_test(), gpu_viewport_draw_colormanaged(), knifetool_draw(), blender::ed::space_node::nodesocket_cache_flush(), pygpu_batch_draw(), blender::ed::vse::sequencer_draw_scopes(), stitch_draw_vbo(), blender::gpu::tests::test_framebuffer_multi_viewport(), blender::gpu::tests::test_framebuffer_subpass_input(), ui_draw_but_UNITVEC(), ui_draw_dropshadow(), UI_draw_roundbox_4fv_ex(), UI_widgetbase_draw_cache_flush(), blender::gpu::tests::vertex_buffer_fetch_mode(), waveform_draw_one(), waveform_draw_rgb(), wm_draw_region_blend(), wm_gizmo_geometryinfo_draw(), wm_xr_controller_model_draw(), wm_xr_raycast_destination_draw(), and wm_xr_raycast_draw().
| void GPU_batch_draw_advanced | ( | blender::gpu::Batch * | batch, |
| int | vertex_first, | ||
| int | vertex_count, | ||
| int | instance_first, | ||
| int | instance_count ) |
Draw the #blender::gpu::Batch custom parameters. IMPORTANT: This does not bind/unbind shader and does not call GPU_matrix_bind().
A vertex_count of 0 will use the default number of vertex. An instance_count of 0 will use the default number of instances.
References batch.
Referenced by blf_batch_draw(), blender::ed::greasepencil::image_render::draw_grease_pencil_stroke(), blender::draw::command::Draw::execute(), blender::gpu::Immediate::polyline_draw_workaround(), and blender::gpu::tests::ShaderSpecializationConst::validate().
| blender::IndexRange GPU_batch_draw_expanded_parameter_get | ( | GPUPrimType | input_prim_type, |
| GPUPrimType | output_prim_type, | ||
| int | vertex_count, | ||
| int | vertex_first, | ||
| int | output_primitive_cout ) |
Return vertex range for this #blender::gpu::Batch when using primitive expansions.
Definition at line 323 of file gpu_batch.cc.
References BLI_assert_msg, GPU_PRIM_LINE_STRIP, and blender::gpu::indices_per_primitive().
Referenced by blender::draw::command::Draw::execute(), blender::draw::command::DrawMultiBuf::generate_commands(), blender::gpu::Immediate::polyline_draw_workaround(), and polyline_draw_workaround().
| void GPU_batch_draw_indirect | ( | blender::gpu::Batch * | batch, |
| blender::gpu::StorageBuf * | indirect_buf, | ||
| intptr_t | offset ) |
Issue a single draw call using arguments sourced from a blender::gpu::StorageBuf. The argument are expected to be valid for the type of geometry contained by this #blender::gpu::Batch (index or non-indexed).
The indirect buffer needs to be synced after filling its contents and before calling this function using GPU_storagebuf_sync_as_indirect_buffer.
For more info see the GL documentation: https://registry.khronos.org/OpenGL-Refpages/gl4/html/glDrawArraysIndirect.xhtml
References batch.
Referenced by blender::draw::command::DrawIndirect::execute(), and blender::draw::command::DrawMulti::execute().
| void GPU_batch_draw_instance_range | ( | blender::gpu::Batch * | batch, |
| int | instance_first, | ||
| int | instance_count ) |
Draw multiple instances of the #blender::gpu::Batch with custom instance range. Ensures the associated shader is bound. TODO(fclem) remove this behavior.
An instance_count of 0 will use the default number of instances. The instance_first sets the start of the instance-rate attributes.
References batch.
Referenced by blender::ed::vse::StripsDrawBatch::flush_batch(), blender::ed::vse::ThumbsDrawBatch::flush_batch(), blender::ed::space_node::nodelink_batch_draw(), blender::ed::space_node::nodesocket_cache_flush(), pygpu_batch_draw_instanced(), and UI_widgetbase_draw_cache_flush().
| void GPU_batch_draw_parameter_get | ( | blender::gpu::Batch * | batch, |
| int * | r_vertex_count, | ||
| int * | r_vertex_first, | ||
| int * | r_base_index, | ||
| int * | r_instance_count ) |
Return indirect draw call parameters for this #blender::gpu::Batch. NOTE: r_base_index is set to -1 if not using an index buffer.
References batch.
Referenced by blender::draw::command::DrawMultiBuf::generate_commands().
| void GPU_batch_draw_range | ( | blender::gpu::Batch * | batch, |
| int | vertex_first, | ||
| int | vertex_count ) |
Draw the #blender::gpu::Batch with vertex count and instance count from its vertex buffers lengths. Ensures the associated shader is bound. TODO(fclem) remove this behavior.
A vertex_count of 0 will use the default number of vertex. The vertex_first sets the start of the instance-rate attributes.
References batch.
Referenced by blender::ed::vse::SeqQuadsBatch::draw(), knifetool_draw(), pygpu_batch_draw_range(), and wm_xr_controller_model_draw().
| void GPU_batch_elembuf_set | ( | blender::gpu::Batch * | batch, |
| blender::gpu::IndexBuf * | index_buf, | ||
| bool | own_ibo ) |
Set the index buffer of a #blender::gpu::Batch.
References batch.
Referenced by DRW_ibo_request().
| void gpu_batch_exit | ( | ) |
Definition at line 541 of file gpu_batch.cc.
References gpu_batch_presets_exit().
Referenced by GPU_exit().
| void gpu_batch_init | ( | ) |
Definition at line 536 of file gpu_batch.cc.
References gpu_batch_presets_init().
Referenced by GPU_init().
| void GPU_batch_init_ex | ( | blender::gpu::Batch * | batch, |
| GPUPrimType | primitive_type, | ||
| blender::gpu::VertBuf * | vertex_buf, | ||
| blender::gpu::IndexBuf * | index_buf, | ||
| GPUBatchFlag | owns_flag ) |
Initialize a cleared #blender::gpu::Batch with explicit buffer ownership. A #blender::gpu::Batch is in cleared state if it was just allocated using GPU_batch_calloc() or cleared using GPU_batch_clear().
References batch.
Referenced by DRW_batch_requested().
| void GPU_batch_multi_draw_indirect | ( | blender::gpu::Batch * | batch, |
| blender::gpu::StorageBuf * | indirect_buf, | ||
| int | count, | ||
| intptr_t | offset, | ||
| intptr_t | stride ) |
Issue count draw calls using arguments sourced from a blender::gpu::StorageBuf. The stride (in bytes) control the spacing between each command description. The argument are expected to be valid for the type of geometry contained by this #blender::gpu::Batch (index or non-indexed).
The indirect buffer needs to be synced after filling its contents and before calling this function using GPU_storagebuf_sync_as_indirect_buffer.
For more info see the GL documentation: https://registry.khronos.org/OpenGL-Refpages/gl4/html/glMultiDrawArraysIndirect.xhtml
| blender::gpu::Batch * GPU_batch_procedural_lines_get | ( | ) |
Batch with no attributes, suited for rendering procedural geometry. IMPORTANT: The returned batch is only valid for the current context.
Definition at line 515 of file gpu_batch.cc.
References blender::gpu::Context::get(), and blender::gpu::Context::procedural_lines_batch_get().
Referenced by blender::draw::command::procedural_batch_get(), and blender::draw::detail::PassBase< DrawCommandBufType >::procedural_batch_get().
| blender::gpu::Batch * GPU_batch_procedural_points_get | ( | ) |
Batch with no attributes, suited for rendering procedural geometry. IMPORTANT: The returned batch is only valid for the current context.
Definition at line 510 of file gpu_batch.cc.
References blender::gpu::Context::get(), and blender::gpu::Context::procedural_points_batch_get().
Referenced by blender::draw::command::procedural_batch_get(), and blender::draw::detail::PassBase< DrawCommandBufType >::procedural_batch_get().
| blender::gpu::Batch * GPU_batch_procedural_triangle_strips_get | ( | ) |
Batch with no attributes, suited for rendering procedural geometry. IMPORTANT: The returned batch is only valid for the current context.
Definition at line 525 of file gpu_batch.cc.
References blender::gpu::Context::get(), and blender::gpu::Context::procedural_triangle_strips_batch_get().
Referenced by blender::draw::command::procedural_batch_get(), and blender::draw::detail::PassBase< DrawCommandBufType >::procedural_batch_get().
| blender::gpu::Batch * GPU_batch_procedural_triangles_get | ( | ) |
Batch with no attributes, suited for rendering procedural geometry. IMPORTANT: The returned batch is only valid for the current context.
Definition at line 520 of file gpu_batch.cc.
References blender::gpu::Context::get(), and blender::gpu::Context::procedural_triangles_batch_get().
Referenced by blender::draw::command::procedural_batch_get(), and blender::draw::detail::PassBase< DrawCommandBufType >::procedural_batch_get().
| void GPU_batch_program_set_builtin | ( | blender::gpu::Batch * | batch, |
| GPUBuiltinShader | shader_id ) |
References batch.
Referenced by blender::gpu::tests::blend_test(), blf_batch_draw(), button2d_draw_intern(), circle_draw_rgb(), blender::ed::curves::curve_draw_stroke_3d(), curve_draw_stroke_3d(), draw_line_bounds(), draw_line_loop(), draw_line_pairs(), blender::ed::space_node::draw_node_socket_batch(), draw_widgetbase_batch(), drawscredge_area(), ED_screen_draw_edges(), gpu_viewport_draw_colormanaged(), knifetool_draw(), blender::ed::space_node::nodelink_batch_draw(), blender::ed::space_node::nodesocket_cache_flush(), blender::ed::vse::SeqQuadsBatch::SeqQuadsBatch(), stitch_draw_vbo(), ui_draw_but_UNITVEC(), ui_draw_dropshadow(), UI_draw_roundbox_4fv_ex(), UI_widgetbase_draw_cache_flush(), blender::gpu::tests::vertex_buffer_fetch_mode(), waveform_draw_one(), waveform_draw_rgb(), wm_gizmo_geometryinfo_draw(), wm_xr_controller_model_draw(), wm_xr_raycast_destination_draw(), and wm_xr_raycast_draw().
| void GPU_batch_program_set_builtin_with_config | ( | blender::gpu::Batch * | batch, |
| GPUBuiltinShader | shader_id, | ||
| GPUShaderConfig | sh_cfg ) |
References batch.
| void GPU_batch_program_set_imm_shader | ( | blender::gpu::Batch * | batch | ) |
Bind program bound to IMM (immediate mode) to the #blender::gpu::Batch.
XXX: Use this with much care. Drawing with the #blender::gpu::Batch API is not compatible with IMM. DO NOT DRAW WITH THE BATCH BEFORE CALLING immUnbindProgram.
References batch.
Referenced by gpu_viewport_draw_colormanaged().
| void GPU_batch_set_shader | ( | blender::gpu::Batch * | batch, |
| blender::gpu::Shader * | shader, | ||
| const blender::gpu::shader::SpecializationConstants * | constants_state = nullptr ) |
Sets the shader to be drawn with this #blender::gpu::Batch.
References batch.
Referenced by blender::render::hydra::DrawTexture::draw(), blender::ed::greasepencil::image_render::draw_grease_pencil_stroke(), blender::draw::command::Draw::execute(), blender::draw::command::DrawMulti::execute(), blender::ed::vse::StripsDrawBatch::flush_batch(), blender::ed::vse::ThumbsDrawBatch::flush_batch(), blender::gpu::tests::gpu_shader_lib_test(), immEnd(), blender::gpu::Immediate::polyline_draw_workaround(), pygpu_batch_draw(), pygpu_batch_draw_instanced(), pygpu_batch_draw_range(), pygpu_batch_program_set(), blender::ed::vse::sequencer_draw_scopes(), blender::gpu::tests::test_framebuffer_multi_viewport(), blender::gpu::tests::test_framebuffer_subpass_input(), blender::gpu::tests::ShaderSpecializationConst::validate(), and wm_draw_region_blend().
| int GPU_batch_vertbuf_add | ( | blender::gpu::Batch * | batch, |
| blender::gpu::VertBuf * | vertex_buf, | ||
| bool | own_vbo ) |
Add the given vertex_buf as vertex buffer to a #blender::gpu::Batch.
References batch.
Referenced by blender::draw::DRW_mesh_batch_cache_create_requested(), DRW_vbo_request(), 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::draw::init_empty_dummy_batch(), and pygpu_batch_vertbuf_add().
| bool GPU_batch_vertbuf_has | ( | const blender::gpu::Batch * | batch, |
| const blender::gpu::VertBuf * | vertex_buf ) |
Returns true if the #GPUbatch has vertex_buf in its vertex buffer list.
References batch.
| void GPU_batch_zero | ( | blender::gpu::Batch * | batch | ) |
References batch.
|
staticconstexpr |
Definition at line 35 of file GPU_batch.hh.
Referenced by blender::gpu::GLVaoCache::insert().
|
staticconstexpr |
Definition at line 34 of file GPU_batch.hh.
|
staticconstexpr |
Definition at line 33 of file GPU_batch.hh.
Referenced by blender::gpu::MTLBatch::bind(), GPU_batch_bind_as_resources(), GPU_batch_clear(), GPU_batch_copy(), GPU_batch_init_ex(), GPU_batch_vertbuf_add(), GPU_batch_vertbuf_has(), PyDoc_STRVAR(), pygpu_batch_vertbuf_add(), blender::gpu::GLVertArray::update_bindings(), and blender::gpu::VKVertexAttributeObject::update_bindings().