|
Blender V4.3
|
#include <GPU_vertex_buffer.hh>
Inherited by blender::gpu::DummyVertexBuffer, blender::gpu::GLVertBuf, blender::gpu::MTLVertBuf, and blender::gpu::VKVertexBuffer.
Public Member Functions | |
| VertBuf () | |
| virtual | ~VertBuf () |
| void | init (const GPUVertFormat &format, GPUUsageType usage) |
| void | clear () |
| void | allocate (uint vert_len) |
| void | resize (uint vert_len) |
| void | upload () |
| virtual void | bind_as_ssbo (uint binding)=0 |
| virtual void | bind_as_texture (uint binding)=0 |
| virtual void | wrap_handle (uint64_t handle)=0 |
| VertBuf * | duplicate () |
| size_t | size_alloc_get () const |
| size_t | size_used_get () const |
| void | reference_add () |
| void | reference_remove () |
| GPUUsageType | get_usage_type () const |
| template<typename T > | |
| MutableSpan< T > | data () |
| virtual void | update_sub (uint start, uint len, const void *data)=0 |
| virtual void | read (void *data) const =0 |
Public Attributes | |
| GPUVertFormat | format = {} |
| uint | vertex_len = 0 |
| uint | vertex_alloc = 0 |
| GPUVertBufStatus | flag = GPU_VERTBUF_INVALID |
| GPUUsageType | extended_usage_ = GPU_USAGE_STATIC |
Static Public Attributes | |
| static size_t | memory_usage = 0 |
Protected Member Functions | |
| virtual void | acquire_data ()=0 |
| virtual void | resize_data ()=0 |
| virtual void | release_data ()=0 |
| virtual void | upload_data ()=0 |
| virtual void | duplicate_data (VertBuf *dst)=0 |
Protected Attributes | |
| uchar * | data_ = nullptr |
| GPUUsageType | usage_ = GPU_USAGE_STATIC |
Implementation of Vertex Buffers. Base class which is then specialized for each implementation (GL, VK, ...).
Definition at line 61 of file GPU_vertex_buffer.hh.
| blender::gpu::VertBuf::VertBuf | ( | ) |
Definition at line 32 of file gpu_vertex_buffer.cc.
|
virtual |
Definition at line 38 of file gpu_vertex_buffer.cc.
References BLI_assert, flag, and GPU_VERTBUF_INVALID.
|
protectedpure virtual |
Implemented in blender::gpu::DummyVertexBuffer, blender::gpu::GLVertBuf, blender::gpu::MTLVertBuf, and blender::gpu::VKVertexBuffer.
Referenced by allocate().
| void blender::gpu::VertBuf::allocate | ( | uint | vert_len | ) |
Definition at line 88 of file gpu_vertex_buffer.cc.
References acquire_data(), BLI_assert, data_, flag, GPU_VERTBUF_DATA_DIRTY, vertex_alloc, and vertex_len.
|
pure virtual |
|
pure virtual |
| void blender::gpu::VertBuf::clear | ( | ) |
Definition at line 66 of file gpu_vertex_buffer.cc.
References flag, GPU_VERTBUF_INVALID, and release_data().
|
inline |
Returns access to the data allocated for the vertex buffer. The size of the data type must match the data type used on the GPU.
Definition at line 142 of file GPU_vertex_buffer.hh.
References blender::MutableSpan< T >::cast(), data_, and size_alloc_get().
Referenced by SeqQuadsBatch::add_line(), SeqQuadsBatch::add_quad(), SeqQuadsBatch::add_wire_quad(), blender::draw::build_poly_other_map_vbo(), blender::draw::build_vertex_face_adjacency_maps(), blender::draw::create_edit_points_position_and_data(), blender::draw::create_edit_points_position_vbo(), blender::draw::create_edit_points_selection(), blender::draw::create_points_position_time_vbo(), blender::draw::curve_create_attribute(), blender::draw::curve_create_curves_pos(), blender::draw::curve_create_edit_data_and_handles(), blender::draw::draw_subdiv_build_cache(), blender::draw::draw_subdiv_cache_update_extra_coarse_face_data(), blender::draw::draw_subdiv_init_origindex_buffer(), blender::draw::draw_subdiv_topology_info_cb(), blender::draw::DRW_vertbuf_create_wiredata(), blender::draw::ensure_control_point_attribute(), blender::draw::extract_attr_viewer(), blender::draw::extract_data_bmesh_edge(), blender::draw::extract_data_bmesh_face(), blender::draw::extract_data_bmesh_loop(), blender::draw::extract_data_bmesh_vert(), blender::draw::pbvh::extract_data_corner_bmesh(), blender::draw::pbvh::extract_data_corner_mesh(), blender::draw::pbvh::extract_data_face_bmesh(), blender::draw::pbvh::extract_data_face_mesh(), blender::draw::extract_data_mesh_face(), blender::draw::extract_data_mesh_mapped_corner(), blender::draw::pbvh::extract_data_vert_bmesh(), blender::draw::pbvh::extract_data_vert_mesh(), blender::draw::extract_edge_factor(), blender::draw::extract_edge_idx_loose_geom_subdiv(), blender::draw::extract_edge_index_subdiv(), blender::draw::extract_edit_data(), blender::draw::extract_edit_data_subdiv(), blender::draw::extract_edit_subdiv_data_bm(), blender::draw::extract_edit_subdiv_data_mesh(), blender::draw::extract_edituv_data(), blender::draw::extract_edituv_data_subdiv(), blender::draw::extract_edituv_lines_subdiv_bm(), blender::draw::extract_edituv_lines_subdiv_mesh(), blender::draw::extract_edituv_points_subdiv_bm(), blender::draw::extract_edituv_points_subdiv_mesh(), blender::draw::extract_edituv_stretch_angle(), blender::draw::extract_edituv_stretch_area(), blender::draw::extract_edituv_stretch_area_subdiv(), blender::draw::extract_edituv_subdiv_data_bm(), blender::draw::extract_edituv_subdiv_data_mesh(), blender::draw::extract_face_dot_normals(), blender::draw::extract_face_dots_edituv_data(), blender::draw::extract_face_dots_position(), blender::draw::extract_face_dots_uv(), blender::draw::extract_face_index_subdiv(), blender::draw::extract_lines_loose_geom_subdiv(), blender::draw::extract_lines_paint_mask_subdiv(), blender::draw::extract_mesh_analysis(), blender::draw::extract_normals(), blender::draw::extract_orco(), blender::draw::extract_points_subdiv_bm(), blender::draw::extract_points_subdiv_mesh(), blender::draw::extract_positions(), blender::draw::extract_positions_subdiv(), blender::draw::extract_sculpt_data(), blender::draw::extract_sculpt_data_subdiv(), blender::draw::extract_skin_roots(), blender::draw::extract_tangents(), blender::draw::extract_tangents_subdiv(), blender::draw::extract_uv_maps(), blender::draw::extract_vert_idx_loose_geom_subdiv(), blender::draw::extract_vert_index_subdiv(), blender::draw::extract_vert_normals(), blender::draw::extract_weights(), blender::draw::pbvh::fill_vbo_face_set_bmesh(), blender::draw::pbvh::fill_vbo_face_set_grids(), blender::draw::pbvh::fill_vbo_face_set_mesh(), blender::draw::pbvh::fill_vbo_mask_bmesh(), blender::draw::pbvh::fill_vbo_mask_grids(), blender::draw::pbvh::fill_vbo_mask_mesh(), blender::draw::pbvh::fill_vbo_normal_bmesh(), blender::draw::pbvh::fill_vbo_normal_grids(), blender::draw::pbvh::fill_vbo_normal_mesh(), blender::draw::pbvh::fill_vbo_position_bmesh(), blender::draw::pbvh::fill_vbo_position_grids(), blender::draw::grease_pencil_edit_batch_ensure(), blender::draw::grease_pencil_geom_batch_ensure(), blender::draw::grease_pencil_weight_batch_ensure(), blender::draw::init_vbo_data(), blender::draw::lattice_batch_cache_create_overlay_batches(), blender::draw::pointcloud_extract_attribute(), blender::draw::pointcloud_extract_position_and_radius(), pygpu_vertbuf_fill(), blender::draw::overlay::vbo_from_vector(), blender::draw::overlay::vbo_from_vector(), blender::draw::overlay::vbo_from_vector(), waveform_draw_rgb(), and wm_xr_controller_model_batch_create().
| VertBuf * blender::gpu::VertBuf::duplicate | ( | ) |
Definition at line 72 of file gpu_vertex_buffer.cc.
References duplicate_data(), extended_usage_, blender::gpu::GPUBackend::get(), and blender::gpu::GPUBackend::vertbuf_alloc().
Referenced by GPU_vertbuf_duplicate().
|
protectedpure virtual |
Implemented in blender::gpu::DummyVertexBuffer, blender::gpu::GLVertBuf, blender::gpu::MTLVertBuf, and blender::gpu::VKVertexBuffer.
Referenced by duplicate().
|
inline |
Definition at line 133 of file GPU_vertex_buffer.hh.
References usage_.
Referenced by blender::gpu::MTLVertBuf::bind(), and blender::gpu::MTLVertBuf::duplicate_data().
| void blender::gpu::VertBuf::init | ( | const GPUVertFormat & | format, |
| GPUUsageType | usage ) |
Definition at line 44 of file gpu_vertex_buffer.cc.
References extended_usage_, flag, GPU_USAGE_FLAG_BUFFER_TEXTURE_ONLY, GPU_VERTBUF_DATA_DIRTY, GPU_VERTBUF_INIT, GPU_vertformat_copy(), GPUVertFormat::packed, usage_, VertexFormat_pack(), and VertexFormat_texture_buffer_pack().
|
pure virtual |
Implemented in blender::gpu::DummyVertexBuffer, blender::gpu::GLVertBuf, blender::gpu::MTLVertBuf, and blender::gpu::VKVertexBuffer.
Referenced by GPU_vertbuf_read().
|
inline |
Definition at line 120 of file GPU_vertex_buffer.hh.
|
inline |
Definition at line 124 of file GPU_vertex_buffer.hh.
References BLI_assert.
|
protectedpure virtual |
Implemented in blender::gpu::DummyVertexBuffer, blender::gpu::GLVertBuf, blender::gpu::MTLVertBuf, and blender::gpu::VKVertexBuffer.
Referenced by clear().
| void blender::gpu::VertBuf::resize | ( | uint | vert_len | ) |
Definition at line 100 of file gpu_vertex_buffer.cc.
References BLI_assert, flag, GPU_VERTBUF_DATA_DIRTY, resize_data(), vertex_alloc, and vertex_len.
|
protectedpure virtual |
Implemented in blender::gpu::DummyVertexBuffer, blender::gpu::GLVertBuf, blender::gpu::MTLVertBuf, and blender::gpu::VKVertexBuffer.
Referenced by resize().
|
inline |
Definition at line 108 of file GPU_vertex_buffer.hh.
References BLI_assert, GPUVertFormat::packed, and GPUVertFormat::stride.
Referenced by blender::gpu::DummyVertexBuffer::acquire_data(), blender::gpu::GLVertBuf::acquire_data(), blender::gpu::MTLVertBuf::acquire_data(), blender::gpu::VKVertexBuffer::acquire_data(), data(), blender::gpu::GLVertBuf::resize_data(), blender::gpu::MTLVertBuf::resize_data(), and blender::gpu::VKVertexBuffer::resize_data().
|
inline |
Definition at line 114 of file GPU_vertex_buffer.hh.
References BLI_assert, and GPUVertFormat::stride.
Referenced by blender::gpu::GLVertBuf::bind(), blender::gpu::MTLVertBuf::bind(), blender::gpu::GLVertBuf::duplicate_data(), and blender::gpu::GLVertBuf::read().
| void blender::gpu::VertBuf::upload | ( | ) |
Definition at line 111 of file gpu_vertex_buffer.cc.
References upload_data().
Referenced by blender::gpu::VKStorageBuffer::copy_sub().
|
protectedpure virtual |
Implemented in blender::gpu::DummyVertexBuffer, blender::gpu::GLVertBuf, blender::gpu::MTLVertBuf, and blender::gpu::VKVertexBuffer.
Referenced by upload().
|
pure virtual |
|
protected |
NULL indicates data in VRAM (unmapped)
Definition at line 80 of file GPU_vertex_buffer.hh.
Referenced by blender::gpu::DummyVertexBuffer::acquire_data(), blender::gpu::GLVertBuf::acquire_data(), blender::gpu::MTLVertBuf::acquire_data(), blender::gpu::VKVertexBuffer::acquire_data(), allocate(), blender::gpu::GLVertBuf::bind(), blender::gpu::MTLVertBuf::bind(), data(), blender::gpu::GLVertBuf::duplicate_data(), blender::gpu::MTLVertBuf::duplicate_data(), blender::gpu::DummyVertexBuffer::release_data(), blender::gpu::GLVertBuf::release_data(), blender::gpu::MTLVertBuf::release_data(), blender::gpu::VKVertexBuffer::release_data(), blender::gpu::GLVertBuf::resize_data(), blender::gpu::MTLVertBuf::resize_data(), blender::gpu::VKVertexBuffer::resize_data(), and blender::gpu::VKVertexBuffer::upload_data().
| GPUUsageType blender::gpu::VertBuf::extended_usage_ = GPU_USAGE_STATIC |
Usage including extended usage flags.
Definition at line 75 of file GPU_vertex_buffer.hh.
Referenced by duplicate(), GPU_texture_create_from_vertbuf(), and init().
| GPUVertBufStatus blender::gpu::VertBuf::flag = GPU_VERTBUF_INVALID |
Status flag.
Definition at line 71 of file GPU_vertex_buffer.hh.
Referenced by allocate(), blender::gpu::GLVertBuf::bind(), blender::gpu::MTLVertBuf::bind(), clear(), DRW_cache_bone_stick_get(), init(), resize(), blender::gpu::VKVertexBuffer::upload_data(), blender::gpu::GLVertBuf::wrap_handle(), blender::gpu::MTLVertBuf::wrap_handle(), and ~VertBuf().
| GPUVertFormat blender::gpu::VertBuf::format = {} |
Definition at line 65 of file GPU_vertex_buffer.hh.
Referenced by bind_attribute_as_ssbo(), and blender::gpu::GLVertArray::update_bindings().
|
static |
Definition at line 63 of file GPU_vertex_buffer.hh.
Referenced by blender::gpu::GLVertBuf::bind(), blender::gpu::GLVertBuf::duplicate_data(), GPU_vertbuf_get_memory_usage(), and blender::gpu::GLVertBuf::release_data().
|
protected |
Usage hint for GL optimization.
Definition at line 83 of file GPU_vertex_buffer.hh.
Referenced by blender::gpu::GLVertBuf::acquire_data(), blender::gpu::MTLVertBuf::acquire_data(), blender::gpu::VKVertexBuffer::acquire_data(), blender::gpu::GLVertBuf::bind(), blender::gpu::MTLVertBuf::bind(), blender::gpu::GLVertBuf::duplicate_data(), get_usage_type(), init(), blender::gpu::MTLVertBuf::read(), blender::gpu::GLVertBuf::resize_data(), blender::gpu::MTLVertBuf::resize_data(), blender::gpu::VKVertexBuffer::resize_data(), and blender::gpu::VKVertexBuffer::upload_data().
| uint blender::gpu::VertBuf::vertex_alloc = 0 |
Number of verts data.
Definition at line 69 of file GPU_vertex_buffer.hh.
Referenced by allocate(), and resize().
| uint blender::gpu::VertBuf::vertex_len = 0 |
Number of verts we want to draw.
Definition at line 67 of file GPU_vertex_buffer.hh.
Referenced by allocate(), blender::gpu::MTLDrawList::append(), blender::gpu::VKDrawList::append(), bind_attribute_as_ssbo(), blender::gpu::MTLTexture::init_internal(), resize(), blender::gpu::GLVertArray::update_bindings(), and blender::gpu::VKVertexAttributeObject::update_bindings().