|
Blender V4.3
|
#include <GPU_index_buffer.hh>
Inherited by blender::gpu::GLIndexBuf, blender::gpu::MTLIndexBuf, and blender::gpu::VKIndexBuffer.
Public Member Functions | |
| IndexBuf () | |
| virtual | ~IndexBuf () |
| void | init (uint indices_len, uint32_t *indices, uint min_index, uint max_index, GPUPrimType prim_type, bool uses_restart_indices) |
| void | init_subrange (IndexBuf *elem_src, uint start, uint length) |
| void | init_build_on_device (uint index_len) |
| uint32_t | index_len_get () const |
| uint32_t | index_start_get () const |
| uint32_t | index_base_get () const |
| bool | is_32bit () const |
| size_t | size_get () const |
| bool | is_init () const |
| virtual void | upload_data ()=0 |
| virtual void | bind_as_ssbo (uint binding)=0 |
| virtual void | read (uint32_t *data) const =0 |
| virtual void | update_sub (uint start, uint len, const void *data)=0 |
Protected Attributes | ||
| GPUIndexBufType | index_type_ = GPU_INDEX_U32 | |
| uint32_t | index_start_ = 0 | |
| uint32_t | index_len_ = 0 | |
| uint32_t | index_base_ = 0 | |
| bool | is_init_ = false | |
| bool | is_subrange_ = false | |
| bool | is_empty_ = false | |
| union { | ||
| void * data_ = nullptr | ||
| IndexBuf * src_ | ||
| }; | ||
Base class which is then specialized for each implementation (GL, VK, ...).
Definition at line 40 of file GPU_index_buffer.hh.
|
inline |
Definition at line 65 of file GPU_index_buffer.hh.
|
virtual |
Definition at line 306 of file gpu_index_buffer.cc.
References data_, is_subrange_, and MEM_SAFE_FREE.
|
pure virtual |
Implemented in blender::gpu::GLIndexBuf, blender::gpu::MTLIndexBuf, and blender::gpu::VKIndexBuffer.
Referenced by GPU_indexbuf_bind_as_ssbo().
|
inline |
Definition at line 88 of file GPU_index_buffer.hh.
References index_base_.
Referenced by blender::gpu::VKDrawList::append().
|
inline |
Definition at line 78 of file GPU_index_buffer.hh.
References index_len_, and is_empty_.
Referenced by blender::gpu::VKDrawList::append().
|
inline |
Definition at line 84 of file GPU_index_buffer.hh.
References index_start_.
Referenced by blender::gpu::VKDrawList::append(), and blender::gpu::VKBatch::draw().
| void blender::gpu::IndexBuf::init | ( | uint | indices_len, |
| uint32_t * | indices, | ||
| uint | min_index, | ||
| uint | max_index, | ||
| GPUPrimType | prim_type, | ||
| bool | uses_restart_indices ) |
Definition at line 313 of file gpu_index_buffer.cc.
References data_, GPU_BACKEND_METAL, GPU_DEVICE_ANY, GPU_DRIVER_ANY, blender::gpu::GPU_INDEX_U16, GPU_OS_MAC, GPU_PRIM_POINTS, GPU_type_matches_ex(), index_len_, index_start_, index_type_, indices, is_empty_, and is_init_.
Referenced by GPU_indexbuf_build_in_place(), GPU_indexbuf_build_in_place_ex(), and GPU_indexbuf_build_in_place_from_memory().
| void blender::gpu::IndexBuf::init_build_on_device | ( | uint | index_len | ) |
Definition at line 366 of file gpu_index_buffer.cc.
References data_, blender::gpu::GPU_INDEX_U32, index_len_, index_start_, index_type_, and is_init_.
Referenced by GPU_indexbuf_init_build_on_device().
Definition at line 375 of file gpu_index_buffer.cc.
References BLI_assert, index_base_, index_len_, index_start_, index_type_, is_init_, is_subrange_, length(), and src_.
Referenced by GPU_indexbuf_create_subrange_in_place().
|
inline |
Definition at line 92 of file GPU_index_buffer.hh.
References blender::gpu::GPU_INDEX_U32, and index_type_.
|
inline |
Definition at line 102 of file GPU_index_buffer.hh.
References is_init_.
Referenced by GPU_indexbuf_is_init().
|
pure virtual |
Implemented in blender::gpu::GLIndexBuf, blender::gpu::MTLIndexBuf, and blender::gpu::VKIndexBuffer.
Referenced by GPU_indexbuf_read().
|
inline |
Definition at line 97 of file GPU_index_buffer.hh.
References index_len_, index_type_, and blender::gpu::to_bytesize().
Referenced by blender::gpu::GLIndexBuf::bind(), blender::gpu::GLIndexBuf::read(), blender::gpu::MTLIndexBuf::read(), blender::gpu::MTLIndexBuf::update_sub(), and blender::gpu::MTLIndexBuf::upload_data().
|
pure virtual |
Implemented in blender::gpu::GLIndexBuf, blender::gpu::MTLIndexBuf, and blender::gpu::VKIndexBuffer.
Referenced by GPU_indexbuf_update_sub().
|
pure virtual |
Implemented in blender::gpu::GLIndexBuf, blender::gpu::MTLIndexBuf, and blender::gpu::VKIndexBuffer.
Referenced by blender::gpu::VKIndexBuffer::ensure_updated(), and GPU_indexbuf_use().
| union { ... } blender::gpu::IndexBuf |
| void* blender::gpu::IndexBuf::data_ = nullptr |
Mapped buffer data. non-NULL indicates not yet sent to VRAM.
Definition at line 59 of file GPU_index_buffer.hh.
Referenced by blender::gpu::GLIndexBuf::bind(), blender::gpu::GLIndexBuf::bind_as_ssbo(), blender::gpu::VKIndexBuffer::ensure_updated(), init(), init_build_on_device(), blender::gpu::MTLIndexBuf::update_sub(), blender::gpu::MTLIndexBuf::upload_data(), and ~IndexBuf().
|
protected |
Base index: Added to all indices after fetching. Allows index compression.
Definition at line 49 of file GPU_index_buffer.hh.
Referenced by blender::gpu::GLDrawList::append(), blender::gpu::MTLDrawList::append(), blender::gpu::MTLBatch::bind(), blender::gpu::GLBatch::draw(), index_base_get(), and init_subrange().
|
protected |
Number of indices to render.
Definition at line 47 of file GPU_index_buffer.hh.
Referenced by blender::gpu::GLDrawList::append(), blender::gpu::MTLDrawList::append(), blender::gpu::MTLIndexBuf::get_index_buffer(), index_len_get(), init(), init_build_on_device(), init_subrange(), and size_get().
|
protected |
Offset in this buffer to the first index to render. Is 0 if not a subrange.
Definition at line 45 of file GPU_index_buffer.hh.
Referenced by blender::gpu::GLDrawList::append(), blender::gpu::MTLDrawList::append(), index_start_get(), init(), init_build_on_device(), init_subrange(), blender::gpu::GLIndexBuf::offset_ptr(), and blender::gpu::MTLDrawList::submit().
|
protected |
Type of indices used inside this buffer.
Definition at line 43 of file GPU_index_buffer.hh.
Referenced by blender::gpu::MTLBatch::bind(), blender::gpu::GLBatch::draw(), blender::gpu::GLBatch::draw_indirect(), blender::gpu::MTLIndexBuf::get_index_buffer(), init(), init_build_on_device(), init_subrange(), is_32bit(), blender::gpu::GLBatch::multi_draw_indirect(), blender::gpu::GLIndexBuf::offset_ptr(), blender::gpu::GLIndexBuf::restart_index(), size_get(), blender::gpu::GLDrawList::submit(), blender::gpu::MTLDrawList::submit(), and blender::gpu::VKIndexBuffer::vk_index_type().
|
protected |
True if buffer only contains restart indices.
Definition at line 55 of file GPU_index_buffer.hh.
Referenced by index_len_get(), and init().
|
protected |
Bookkeeping.
Definition at line 51 of file GPU_index_buffer.hh.
Referenced by init(), init_build_on_device(), init_subrange(), and is_init().
|
protected |
Is this object only a reference to a subrange of another IndexBuf.
Definition at line 53 of file GPU_index_buffer.hh.
Referenced by blender::gpu::GLIndexBuf::bind(), blender::gpu::VKIndexBuffer::ensure_updated(), blender::gpu::MTLIndexBuf::get_index_buffer(), init_subrange(), blender::gpu::MTLIndexBuf::update_sub(), blender::gpu::MTLIndexBuf::upload_data(), ~IndexBuf(), and blender::gpu::MTLIndexBuf::~MTLIndexBuf().
| IndexBuf* blender::gpu::IndexBuf::src_ |
If is_subrange is true, this is the source index buffer.
Definition at line 61 of file GPU_index_buffer.hh.
Referenced by blender::gpu::GLIndexBuf::bind(), blender::gpu::VKIndexBuffer::ensure_updated(), init_subrange(), and blender::gpu::MTLIndexBuf::upload_data().