Blender  V2.93
Public Member Functions | Protected Attributes | List of all members
blender::gpu::IndexBuf Class Reference

#include <gpu_index_buffer_private.hh>

Inherited by blender::gpu::GLIndexBuf.

Public Member Functions

 IndexBuf ()
 
virtual ~IndexBuf ()
 
void init (uint indices_len, uint32_t *indices)
 
void init_subrange (IndexBuf *elem_src, uint start, uint length)
 
uint32_t index_len_get (void) const
 
size_t size_get (void)
 
bool is_init (void) const
 

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
 
union {
   void *   data_ = nullptr
 
   IndexBuf *   src_
 
}; 
 

Detailed Description

Base class which is then specialized for each implementation (GL, VK, ...).

Note
IndexBuf does not hold any GPUPrimType. This is because it can be interpreted differently by multiple batches.

Definition at line 50 of file gpu_index_buffer_private.hh.

Constructor & Destructor Documentation

◆ IndexBuf()

blender::gpu::IndexBuf::IndexBuf ( )
inline

Definition at line 73 of file gpu_index_buffer_private.hh.

◆ ~IndexBuf()

blender::gpu::IndexBuf::~IndexBuf ( )
virtual

Definition at line 215 of file gpu_index_buffer.cc.

References data_, is_subrange_, and MEM_SAFE_FREE.

Member Function Documentation

◆ index_len_get()

uint32_t blender::gpu::IndexBuf::index_len_get ( void  ) const
inline

Definition at line 79 of file gpu_index_buffer_private.hh.

References index_len_.

◆ init()

void blender::gpu::IndexBuf::init ( uint  indices_len,
uint32_t indices 
)

◆ init_subrange()

void blender::gpu::IndexBuf::init_subrange ( IndexBuf elem_src,
uint  start,
uint  length 
)

◆ is_init()

bool blender::gpu::IndexBuf::is_init ( void  ) const
inline

Definition at line 89 of file gpu_index_buffer_private.hh.

References is_init_.

◆ size_get()

size_t blender::gpu::IndexBuf::size_get ( void  )
inline

Member Data Documentation

◆ 

union { ... }

◆ data_

void* blender::gpu::IndexBuf::data_ = nullptr

Mapped buffer data. non-NULL indicates not yet sent to VRAM.

Definition at line 67 of file gpu_index_buffer_private.hh.

Referenced by blender::gpu::GLIndexBuf::bind(), init(), and ~IndexBuf().

◆ index_base_

uint32_t blender::gpu::IndexBuf::index_base_ = 0
protected

Base index: Added to all indices after fetching. Allows index compression.

Definition at line 59 of file gpu_index_buffer_private.hh.

Referenced by blender::gpu::GLDrawList::append(), blender::gpu::GLBatch::draw(), and init_subrange().

◆ index_len_

uint32_t blender::gpu::IndexBuf::index_len_ = 0
protected

Number of indices to render.

Definition at line 57 of file gpu_index_buffer_private.hh.

Referenced by blender::gpu::GLDrawList::append(), index_len_get(), init(), init_subrange(), and size_get().

◆ index_start_

uint32_t blender::gpu::IndexBuf::index_start_ = 0
protected

Offset in this buffer to the first index to render. Is 0 if not a subrange.

Definition at line 55 of file gpu_index_buffer_private.hh.

Referenced by blender::gpu::GLDrawList::append(), init(), init_subrange(), and blender::gpu::GLIndexBuf::offset_ptr().

◆ index_type_

GPUIndexBufType blender::gpu::IndexBuf::index_type_ = GPU_INDEX_U32
protected

◆ is_init_

bool blender::gpu::IndexBuf::is_init_ = false
protected

Bookkeeping.

Definition at line 61 of file gpu_index_buffer_private.hh.

Referenced by init(), init_subrange(), and is_init().

◆ is_subrange_

bool blender::gpu::IndexBuf::is_subrange_ = false
protected

Is this object only a reference to a subrange of another IndexBuf.

Definition at line 63 of file gpu_index_buffer_private.hh.

Referenced by blender::gpu::GLIndexBuf::bind(), init_subrange(), and ~IndexBuf().

◆ src_

IndexBuf* blender::gpu::IndexBuf::src_

If is_subrange is true, this is the source index buffer.

Definition at line 69 of file gpu_index_buffer_private.hh.

Referenced by blender::gpu::GLIndexBuf::bind(), and init_subrange().


The documentation for this class was generated from the following files: