|
Blender V4.3
|
#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_uniform_buffer.hh"#include "GPU_vertex_buffer.hh"Go to the source code of this file.
Macros | |
| #define | GPU_BATCH_VBO_MAX_LEN 16 |
| #define | GPU_BATCH_INST_VBO_MAX_LEN 2 |
| #define | GPU_BATCH_VAO_STATIC_LEN 3 |
| #define | GPU_BATCH_VAO_DYN_ALLOC_COUNT 16 |
| #define | GPU_BATCH_OWNS_NONE GPU_BATCH_INVALID |
Enumerations | |
| enum | eGPUBatchFlag { 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_INST_VBO = (GPU_BATCH_OWNS_VBO_MAX << 1) , GPU_BATCH_OWNS_INST_VBO_MAX = (GPU_BATCH_OWNS_INST_VBO << (GPU_BATCH_INST_VBO_MAX_LEN - 1)) , GPU_BATCH_OWNS_INST_VBO_ANY , GPU_BATCH_OWNS_INDEX = (GPU_BATCH_OWNS_INST_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) |
| int | GPU_batch_instbuf_add (blender::gpu::Batch *batch, blender::gpu::VertBuf *vertex_buf, bool own_vbo) |
| void | GPU_batch_instbuf_set (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) |
| void | GPU_batch_resource_id_buf_set (blender::gpu::Batch *batch, GPUStorageBuf *resource_id_buf) |
Module init/exit | |
| void | gpu_batch_init () |
| void | gpu_batch_exit () |
Creation | |
| #define | GPU_batch_create(primitive_type, vertex_buf, index_buf) GPU_batch_create_ex(primitive_type, vertex_buf, index_buf, (eGPUBatchFlag)0) |
| #define | GPU_batch_init(batch, primitive_type, vertex_buf, index_buf) GPU_batch_init_ex(batch, primitive_type, vertex_buf, index_buf, (eGPUBatchFlag)0) |
| blender::gpu::Batch * | GPU_batch_create_ex (GPUPrimType primitive_type, blender::gpu::VertBuf *vertex_buf, blender::gpu::IndexBuf *index_buf, eGPUBatchFlag owns_flag) |
| void | GPU_batch_init_ex (blender::gpu::Batch *batch, GPUPrimType primitive_type, blender::gpu::VertBuf *vertex_buf, blender::gpu::IndexBuf *index_buf, eGPUBatchFlag 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) |
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.
Definition at line 191 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 ) GPU_batch_create_ex(primitive_type, vertex_buf, index_buf, (eGPUBatchFlag)0) |
Creates a #blender::gpu::Batch without buffer ownership.
Definition at line 149 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(), mpath_batch_line_get(), mpath_batch_points_get(), pygpu_batch__tp_new(), blender::draw::overlay::ShapeCache::ShapeCache(), and blender::gpu::tests::vertex_buffer_fetch_mode().
Definition at line 205 of file GPU_batch.hh.
Referenced by animviz_calc_motionpaths(), animviz_free_motionpath_cache(), blf_batch_draw_exit(), blender::draw::clear_edit_data(), blender::draw::clear_final_data(), blender::draw::curve_batch_cache_clear(), blender::draw::DRW_cache_gpencil_sbuffer_clear(), 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(), DRW_shape_cache_free(), blender::draw::pbvh::free_batches(), gizmo_button2d_free(), blender::draw::gpencil_batch_cache_clear(), blender::draw::grease_pencil_batch_cache_clear(), blender::draw::lattice_batch_cache_clear(), blender::draw::mesh_batch_cache_clear(), blender::draw::mesh_batch_cache_discard_batch(), blender::draw::mesh_batch_cache_discard_surface_batches(), 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(), temp_batch_free(), temp_instancing_handle_free(), and blender::draw::volume_batch_cache_clear().
| #define GPU_batch_init | ( | batch, | |
| primitive_type, | |||
| vertex_buf, | |||
| index_buf ) GPU_batch_init_ex(batch, primitive_type, vertex_buf, index_buf, (eGPUBatchFlag)0) |
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 167 of file GPU_batch.hh.
Referenced by DRW_temp_batch_request().
| #define GPU_BATCH_INST_VBO_MAX_LEN 2 |
Definition at line 33 of file GPU_batch.hh.
Referenced by DRW_instance_buffer_finish(), GPU_batch_clear(), GPU_batch_instbuf_add(), instancing_batch_references_add(), instancing_batch_references_remove(), blender::gpu::GLVertArray::update_bindings(), and blender::gpu::VKVertexAttributeObject::update_bindings().
| #define GPU_BATCH_OWNS_NONE GPU_BATCH_INVALID |
Definition at line 61 of file GPU_batch.hh.
| #define GPU_batch_texture_bind | ( | batch, | |
| name, | |||
| tex ) GPU_texture_bind(tex, GPU_shader_get_sampler_binding((batch)->shader, name)); |
Definition at line 316 of file GPU_batch.hh.
Referenced by blf_batch_draw(), and DRW_transform_none().
| #define GPU_batch_uniform_1b | ( | batch, | |
| name, | |||
| x ) GPU_shader_uniform_1b((batch)->shader, name, x); |
Definition at line 298 of file GPU_batch.hh.
| #define GPU_batch_uniform_1f | ( | batch, | |
| name, | |||
| x ) GPU_shader_uniform_1f((batch)->shader, name, x); |
Definition at line 299 of file GPU_batch.hh.
Referenced by button2d_draw_intern(), draw_line_bounds(), draw_line_loop(), draw_line_pairs(), ED_screen_draw_edges(), and ui_draw_dropshadow().
| #define GPU_batch_uniform_1i | ( | batch, | |
| name, | |||
| x ) GPU_shader_uniform_1i((batch)->shader, name, x); |
Set uniform variables for the shader currently bound to the #blender::gpu::Batch.
Definition at line 297 of file GPU_batch.hh.
Referenced by blf_batch_draw(), ED_screen_draw_edges(), and gpu_viewport_draw_colormanaged().
| #define GPU_batch_uniform_2f | ( | batch, | |
| name, | |||
| x, | |||
| y ) GPU_shader_uniform_2f((batch)->shader, name, x, y); |
Definition at line 300 of file GPU_batch.hh.
| #define GPU_batch_uniform_2fv | ( | batch, | |
| name, | |||
| val ) GPU_shader_uniform_2fv((batch)->shader, name, val); |
Definition at line 305 of file GPU_batch.hh.
Referenced by button2d_draw_intern(), draw_line_bounds(), draw_line_loop(), and draw_line_pairs().
| #define GPU_batch_uniform_2fv_array | ( | batch, | |
| name, | |||
| len, | |||
| val ) GPU_shader_uniform_2fv_array((batch)->shader, name, len, val); |
Definition at line 308 of file GPU_batch.hh.
| #define GPU_batch_uniform_3f | ( | batch, | |
| name, | |||
| x, | |||
| y, | |||
| z ) GPU_shader_uniform_3f((batch)->shader, name, x, y, z); |
Definition at line 301 of file GPU_batch.hh.
| #define GPU_batch_uniform_3fv | ( | batch, | |
| name, | |||
| val ) GPU_shader_uniform_3fv((batch)->shader, name, val); |
Definition at line 306 of file GPU_batch.hh.
Referenced by blender::ed::curves::curve_draw_stroke_3d(), curve_draw_stroke_3d(), draw_widgetbase_batch(), and UI_widgetbase_draw_cache_flush().
| #define GPU_batch_uniform_4f | ( | batch, | |
| name, | |||
| x, | |||
| y, | |||
| z, | |||
| w ) GPU_shader_uniform_4f((batch)->shader, name, x, y, z, w); |
Definition at line 303 of file GPU_batch.hh.
Referenced by DRW_transform_none(), and waveform_draw_one().
| #define GPU_batch_uniform_4fv | ( | batch, | |
| name, | |||
| val ) GPU_shader_uniform_4fv((batch)->shader, name, val); |
Definition at line 307 of file GPU_batch.hh.
Referenced by blender::gpu::tests::blend_test(), draw_line_bounds(), draw_line_loop(), draw_line_pairs(), drawscredge_area_draw(), ED_screen_draw_edges(), knifetool_draw(), stitch_draw_vbo(), wm_gizmo_geometryinfo_draw(), and wm_xr_controller_model_draw().
| #define GPU_batch_uniform_4fv_array | ( | batch, | |
| name, | |||
| len, | |||
| val ) GPU_shader_uniform_4fv_array((batch)->shader, name, len, val); |
Definition at line 310 of file GPU_batch.hh.
Referenced by draw_widgetbase_batch(), ui_draw_dropshadow(), UI_draw_roundbox_4fv_ex(), and UI_widgetbase_draw_cache_flush().
| #define GPU_batch_uniform_mat4 | ( | batch, | |
| name, | |||
| val ) GPU_shader_uniform_mat4((batch)->shader, name, val); |
Definition at line 312 of file GPU_batch.hh.
| #define GPU_batch_uniformbuf_bind | ( | batch, | |
| name, | |||
| ubo ) GPU_uniformbuf_bind(ubo, GPU_shader_get_ubo_binding((batch)->shader, name)); |
Definition at line 314 of file GPU_batch.hh.
Referenced by DRW_draw_depth_object(), blender::ed::space_node::node_draw_link_bezier_ex(), blender::ed::space_node::nodelink_batch_draw(), and ui_draw_but_UNITVEC().
| #define GPU_BATCH_VAO_DYN_ALLOC_COUNT 16 |
Definition at line 35 of file GPU_batch.hh.
Referenced by blender::gpu::GLVaoCache::insert().
| #define GPU_BATCH_VAO_STATIC_LEN 3 |
Definition at line 34 of file GPU_batch.hh.
| #define GPU_BATCH_VBO_MAX_LEN 16 |
Definition at line 32 of file GPU_batch.hh.
Referenced by blender::gpu::MTLBatch::bind(), DRW_temp_batch_instance_request(), GPU_batch_bind_as_resources(), GPU_batch_clear(), GPU_batch_copy(), GPU_batch_init_ex(), GPU_batch_vertbuf_add(), GPU_batch_vertbuf_has(), instancing_batch_references_add(), instancing_batch_references_remove(), pygpu_batch_vertbuf_add(), blender::gpu::GLVertArray::update_bindings(), and blender::gpu::VKVertexAttributeObject::update_bindings().
| enum eGPUBatchFlag |
| 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_INST_VBO | Instance blender::gpu::VertBuf ownership. (One bit per vbo) |
| GPU_BATCH_OWNS_INST_VBO_MAX | |
| GPU_BATCH_OWNS_INST_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, |
| GPUShader * | shader ) |
Bind vertex and index buffers to SSBOs using Frequency::GEOMETRY.
Referenced by 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.
Referenced by DRW_temp_batch_instance_request(), and DRW_temp_batch_request().
| 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.
Referenced by DRW_instance_buffer_finish().
| blender::gpu::Batch * GPU_batch_create_ex | ( | GPUPrimType | primitive_type, |
| blender::gpu::VertBuf * | vertex_buf, | ||
| blender::gpu::IndexBuf * | index_buf, | ||
| eGPUBatchFlag | 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 56 of file gpu_batch.cc.
References batch, GPU_batch_calloc(), and GPU_batch_init_ex().
Referenced by batch_screen_edges_get(), batch_sphere_wire(), blf_batch_draw_init(), blender::draw::calc_final_indices(), circle_draw_rgb(), draw_line_bounds(), draw_line_loop(), draw_line_pairs(), blender::render::hydra::DrawTexture::DrawTexture(), DRW_cache_bone_arrows_get(), DRW_cache_bone_box_get(), DRW_cache_bone_box_wire_get(), DRW_cache_bone_dof_lines_get(), DRW_cache_bone_dof_sphere_get(), DRW_cache_bone_envelope_outline_get(), DRW_cache_bone_envelope_solid_get(), DRW_cache_bone_octahedral_get(), DRW_cache_bone_octahedral_wire_get(), DRW_cache_bone_point_get(), DRW_cache_bone_point_wire_outline_get(), DRW_cache_bone_stick_get(), DRW_cache_camera_distances_get(), DRW_cache_camera_frame_get(), DRW_cache_camera_tria_get(), DRW_cache_camera_tria_wire_get(), DRW_cache_camera_volume_get(), DRW_cache_camera_volume_wire_get(), DRW_cache_circle_get(), DRW_cache_cube_get(), DRW_cache_cursor_get(), DRW_cache_empty_capsule_body_get(), DRW_cache_empty_capsule_cap_get(), DRW_cache_empty_cone_get(), DRW_cache_empty_cube_get(), DRW_cache_empty_cylinder_get(), DRW_cache_empty_sphere_get(), DRW_cache_field_cone_limit_get(), DRW_cache_field_curve_get(), DRW_cache_field_force_get(), DRW_cache_field_sphere_limit_get(), DRW_cache_field_tube_limit_get(), DRW_cache_field_vortex_get(), DRW_cache_field_wind_get(), DRW_cache_fullscreen_quad_get(), DRW_cache_grid_get(), DRW_cache_groundline_get(), DRW_cache_light_area_disk_lines_get(), DRW_cache_light_area_square_lines_get(), DRW_cache_light_icon_inner_lines_get(), DRW_cache_light_icon_outer_lines_get(), DRW_cache_light_icon_sun_rays_get(), DRW_cache_light_point_lines_get(), DRW_cache_light_spot_lines_get(), DRW_cache_light_spot_volume_get(), DRW_cache_light_sun_lines_get(), DRW_cache_lightprobe_cube_get(), DRW_cache_lightprobe_grid_get(), DRW_cache_lightprobe_planar_get(), DRW_cache_normal_arrow_get(), DRW_cache_particles_get_prim(), DRW_cache_plain_axes_get(), drw_cache_procedural_lines_get(), drw_cache_procedural_points_get(), drw_cache_procedural_triangle_strips_get(), drw_cache_procedural_triangles_get(), DRW_cache_quad_get(), DRW_cache_quad_wires_get(), DRW_cache_single_arrow_get(), DRW_cache_speaker_get(), DRW_cache_sphere_get(), DRW_gpencil_dummy_buffer_get(), blender::draw::drw_volume_selection_surface_cb(), blender::draw::drw_volume_wireframe_cb(), gpu_batch_preset_panel_drag_widget(), GPU_batch_preset_quad(), gpu_batch_sphere(), GPU_batch_tris_from_poly_2d_encoded(), GPU_batch_wire_from_poly_2d_encoded(), blender::gpu::tests::gpu_shader_lib_test(), gpu_viewport_batch_create(), immBeginBatch(), knifetool_draw(), blender::draw::lattice_batch_cache_create_overlay_batches(), blender::ed::space_node::nodelink_batch_init(), blender::draw::particle_batch_cache_ensure_procedural_indices(), SeqQuadsBatch::SeqQuadsBatch(), blender::draw::overlay::ShapeCache::ShapeCache(), stitch_draw_vbo(), blender::gpu::tests::test_framebuffer_multi_viewport(), blender::gpu::tests::test_framebuffer_subpass_input(), ui_batch_roundbox_shadow_get(), ui_batch_roundbox_widget_get(), blender::gpu::tests::ShaderSpecializationConst::validate(), waveform_draw_one(), waveform_draw_rgb(), wm_gizmo_geometryinfo_draw(), and wm_xr_controller_model_batch_create().
| void GPU_batch_discard | ( | blender::gpu::Batch * | batch | ) |
Free a #blender::gpu::Batch object. Discards all owned vertex and index buffers.
Referenced by circle_draw_rgb(), draw_line_bounds(), draw_line_loop(), draw_line_pairs(), GPU_batch_preset_panel_drag_widget(), 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(), 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(), blender::render::hydra::DrawTexture::~DrawTexture(), SeqQuadsBatch::~SeqQuadsBatch(), and blender::draw::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.
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(), blender::render::hydra::DrawTexture::draw(), draw_line_bounds(), draw_line_loop(), draw_line_pairs(), draw_widgetbase_batch(), drawscredge_area_draw(), DRW_draw_cursor(), DRW_draw_cursor_2d_ex(), DRW_draw_depth_object(), DRW_transform_none(), gpu_viewport_draw_colormanaged(), knifetool_draw(), blender::ed::space_node::node_draw_link_bezier_ex(), blender::ed::space_node::nodelink_batch_draw(), panel_draw_aligned_widgets(), pygpu_batch_draw(), stitch_draw_vbo(), 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(), and wm_xr_controller_model_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.
Referenced by blender::gpu::GLDrawList::append(), blender::gpu::MTLDrawList::append(), draw_geometry_execute(), blender::draw::command::Draw::execute(), blender::gpu::tests::gpu_shader_lib_test(), blender::gpu::tests::test_framebuffer_multi_viewport(), and blender::gpu::tests::ShaderSpecializationConst::validate().
| blender::IndexRange GPU_batch_draw_expanded_parameter_get | ( | const blender::gpu::Batch * | batch, |
| GPUPrimType | expanded_prim_type, | ||
| int | vertex_count, | ||
| int | vertex_first ) |
Return vertex range for this #blender::gpu::Batch when using primitive expansions.
Definition at line 355 of file gpu_batch.cc.
References batch, BLI_assert_msg, and blender::gpu::indices_per_primitive().
Referenced by blender::draw::command::DrawMultiBuf::bind(), and blender::draw::command::Draw::execute().
| void GPU_batch_draw_indirect | ( | blender::gpu::Batch * | batch, |
| GPUStorageBuf * | indirect_buf, | ||
| intptr_t | offset ) |
Issue a single draw call using arguments sourced from a #GPUStorageBuf. 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
Referenced by draw_call_indirect(), 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.
Referenced by blender::ed::seq::StripsDrawBatch::flush_batch(), ThumbsDrawBatch::flush_batch(), 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.
Referenced by blender::draw::command::DrawMultiBuf::bind().
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.
Referenced by 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.
Referenced by DRW_ibo_request().
| void gpu_batch_exit | ( | ) |
Definition at line 479 of file gpu_batch.cc.
References gpu_batch_presets_exit().
Referenced by GPU_exit().
| void gpu_batch_init | ( | ) |
Definition at line 474 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, | ||
| eGPUBatchFlag | 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().
Referenced by DRW_batch_requested().
| int GPU_batch_instbuf_add | ( | blender::gpu::Batch * | batch, |
| blender::gpu::VertBuf * | vertex_buf, | ||
| bool | own_vbo ) |
Add the given vertex_buf as instanced vertex buffer to a #blender::gpu::Batch.
Referenced by DRW_instance_buffer_finish().
| void GPU_batch_instbuf_set | ( | blender::gpu::Batch * | batch, |
| blender::gpu::VertBuf * | vertex_buf, | ||
| bool | own_vbo ) |
Set the first instanced vertex buffer of a #blender::gpu::Batch.
Referenced by blf_batch_draw_init(), and blender::ed::space_node::nodelink_batch_init().
| void GPU_batch_multi_draw_indirect | ( | blender::gpu::Batch * | batch, |
| GPUStorageBuf * | indirect_buf, | ||
| int | count, | ||
| intptr_t | offset, | ||
| intptr_t | stride ) |
Issue count draw calls using arguments sourced from a #GPUStorageBuf. 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
| void GPU_batch_program_set_builtin | ( | blender::gpu::Batch * | batch, |
| eGPUBuiltinShader | shader_id ) |
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(), draw_widgetbase_batch(), drawscredge_area_draw(), DRW_transform_none(), ED_screen_draw_edges(), gpu_viewport_draw_colormanaged(), knifetool_draw(), blender::ed::space_node::node_draw_link_bezier_ex(), blender::ed::space_node::nodelink_batch_draw(), panel_draw_aligned_widgets(), 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(), and wm_xr_controller_model_draw().
| void GPU_batch_program_set_builtin_with_config | ( | blender::gpu::Batch * | batch, |
| eGPUBuiltinShader | shader_id, | ||
| eGPUShaderConfig | sh_cfg ) |
Referenced by DRW_draw_depth_object().
| 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.
Referenced by gpu_viewport_draw_colormanaged().
| void GPU_batch_resource_id_buf_set | ( | blender::gpu::Batch * | batch, |
| GPUStorageBuf * | resource_id_buf ) |
Set resource id buffer to bind as instance attribute to workaround the lack of gl_BaseInstance on some hardware / platform.
Referenced by blender::draw::command::Draw::execute(), and blender::draw::command::DrawMulti::execute().
| void GPU_batch_set_shader | ( | blender::gpu::Batch * | batch, |
| GPUShader * | shader ) |
Sets the shader to be drawn with this #blender::gpu::Batch.
GPU_batch_uniform_* functions to work. Referenced by blender::render::hydra::DrawTexture::draw(), draw_call_indirect(), draw_geometry_bind(), DRW_draw_cursor(), DRW_draw_cursor_2d_ex(), blender::draw::command::Draw::execute(), blender::draw::command::DrawMulti::execute(), blender::ed::seq::StripsDrawBatch::flush_batch(), ThumbsDrawBatch::flush_batch(), blender::gpu::tests::gpu_shader_lib_test(), immEnd(), pygpu_batch_draw(), pygpu_batch_draw_instanced(), pygpu_batch_draw_range(), pygpu_batch_program_set(), 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.
Referenced by 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(), 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.
| void GPU_batch_zero | ( | blender::gpu::Batch * | batch | ) |