Blender
V3.3
|
#include <gpu_index_buffer_private.hh>
Public Member Functions | |
IndexBuf () | |
virtual | ~IndexBuf () |
void | init (uint indices_len, uint32_t *indices, uint min_index, uint max_index) |
void | init_subrange (IndexBuf *elem_src, uint start, uint length) |
void | init_build_on_device (uint index_len) |
uint32_t | index_len_get () const |
size_t | size_get () const |
bool | is_init () const |
virtual void | upload_data ()=0 |
virtual void | bind_as_ssbo (uint binding)=0 |
virtual const uint32_t * | read () const =0 |
uint32_t * | unmap (const uint32_t *mapped_memory) const |
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 34 of file gpu_index_buffer_private.hh.
|
inline |
Definition at line 59 of file gpu_index_buffer_private.hh.
|
virtual |
Definition at line 222 of file gpu_index_buffer.cc.
References data_, is_subrange_, and MEM_SAFE_FREE.
Implemented in blender::gpu::GLIndexBuf.
|
inline |
Definition at line 67 of file gpu_index_buffer_private.hh.
References index_len_, and is_empty_.
void blender::gpu::IndexBuf::init | ( | uint | indices_len, |
uint32_t * | indices, | ||
uint | min_index, | ||
uint | max_index | ||
) |
Definition at line 229 of file gpu_index_buffer.cc.
References data_, blender::gpu::GPU_INDEX_U16, index_len_, index_start_, index_type_, indices, is_empty_, and is_init_.
Definition at line 251 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 260 of file gpu_index_buffer.cc.
References BLI_assert, index_base_, index_len_, index_start_, index_type_, is_init_, is_subrange_, blender::math::length(), and src_.
|
inline |
Definition at line 79 of file gpu_index_buffer_private.hh.
References is_init_.
|
pure virtual |
Implemented in blender::gpu::GLIndexBuf.
|
inline |
Definition at line 74 of file gpu_index_buffer_private.hh.
References index_len_, index_type_, and blender::gpu::to_bytesize().
Referenced by blender::gpu::GLIndexBuf::bind(), and unmap().
Definition at line 326 of file gpu_index_buffer.cc.
References MEM_mallocN, result, size(), and size_get().
|
pure virtual |
Implemented in blender::gpu::GLIndexBuf.
|
pure virtual |
Implemented in blender::gpu::GLIndexBuf.
union { ... } |
void* blender::gpu::IndexBuf::data_ = nullptr |
Mapped buffer data. non-NULL indicates not yet sent to VRAM.
Definition at line 53 of file gpu_index_buffer_private.hh.
Referenced by blender::gpu::GLIndexBuf::bind(), blender::gpu::GLIndexBuf::bind_as_ssbo(), init(), init_build_on_device(), and ~IndexBuf().
|
protected |
Base index: Added to all indices after fetching. Allows index compression.
Definition at line 43 of file gpu_index_buffer_private.hh.
Referenced by blender::gpu::GLDrawList::append(), blender::gpu::GLBatch::draw(), and init_subrange().
|
protected |
Number of indices to render.
Definition at line 41 of file gpu_index_buffer_private.hh.
Referenced by blender::gpu::GLDrawList::append(), 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 39 of file gpu_index_buffer_private.hh.
Referenced by blender::gpu::GLDrawList::append(), init(), init_build_on_device(), init_subrange(), and blender::gpu::GLIndexBuf::offset_ptr().
|
protected |
Type of indices used inside this buffer.
Definition at line 37 of file gpu_index_buffer_private.hh.
Referenced by blender::gpu::GLBatch::draw(), init(), init_build_on_device(), init_subrange(), blender::gpu::GLIndexBuf::offset_ptr(), blender::gpu::GLIndexBuf::restart_index(), size_get(), and blender::gpu::GLDrawList::submit().
|
protected |
True if buffer only contains restart indices.
Definition at line 49 of file gpu_index_buffer_private.hh.
Referenced by index_len_get(), and init().
|
protected |
Bookkeeping.
Definition at line 45 of file gpu_index_buffer_private.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 47 of file gpu_index_buffer_private.hh.
Referenced by blender::gpu::GLIndexBuf::bind(), init_subrange(), and ~IndexBuf().
IndexBuf* blender::gpu::IndexBuf::src_ |
If is_subrange is true, this is the source index buffer.
Definition at line 55 of file gpu_index_buffer_private.hh.
Referenced by blender::gpu::GLIndexBuf::bind(), and init_subrange().