Blender V5.3
blender::gpu::IndexBuf Class Referenceabstract

#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
GPUIndexBufType index_type () 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
virtual void copy_sub (IndexBuf &source_buf, uint source_first_index, uint dest_first_index, uint index_len)=0
 Copy part of source index buffer into this index buffer.

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 blender::gpu::IndexBuf:: { ... }  

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 42 of file GPU_index_buffer.hh.

Constructor & Destructor Documentation

◆ IndexBuf()

◆ ~IndexBuf()

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

Definition at line 292 of file gpu_index_buffer.cc.

References is_subrange_.

Member Function Documentation

◆ bind_as_ssbo()

virtual void blender::gpu::IndexBuf::bind_as_ssbo ( uint binding)
pure virtual

◆ copy_sub()

virtual void blender::gpu::IndexBuf::copy_sub ( IndexBuf & source_buf,
uint source_first_index,
uint dest_first_index,
uint index_len )
pure virtual

Copy part of source index buffer into this index buffer.

Note
: index type of both buffers must be identical.
: asserts when the copy range exceeds the bounds of either buffer.
: both index buffers must be uploaded with GPU_indexbuf_use before calling.
Parameters
source_bufsource index buffer to copy data from.
source_first_indexstarting index to start copying the data from.
dest_first_indexstarting index to copy the data to.
index_lenthe number of indices to copy.

Implemented in blender::gpu::GLIndexBuf, blender::gpu::MTLIndexBuf, and blender::gpu::VKIndexBuffer.

References IndexBuf().

Referenced by blender::GPU_indexbuf_copy_sub().

◆ index_base_get()

uint32_t blender::gpu::IndexBuf::index_base_get ( ) const
inline

◆ index_len_get()

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

◆ index_start_get()

uint32_t blender::gpu::IndexBuf::index_start_get ( ) const
inline

◆ index_type()

GPUIndexBufType blender::gpu::IndexBuf::index_type ( ) const
inline

Definition at line 98 of file GPU_index_buffer.hh.

References index_type_.

Referenced by blender::gpu::MTLBottomLevelAS::add_geometry().

◆ init()

◆ init_build_on_device()

void blender::gpu::IndexBuf::init_build_on_device ( uint index_len)

◆ init_subrange()

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

◆ is_32bit()

bool blender::gpu::IndexBuf::is_32bit ( ) const
inline

◆ is_init()

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

Definition at line 108 of file GPU_index_buffer.hh.

References is_init_.

Referenced by blender::GPU_indexbuf_is_init().

◆ read()

virtual void blender::gpu::IndexBuf::read ( uint32_t * data) const
pure virtual

◆ size_get()

◆ update_sub()

virtual void blender::gpu::IndexBuf::update_sub ( uint start,
uint len,
const void * data )
pure virtual

◆ upload_data()

virtual void blender::gpu::IndexBuf::upload_data ( )
pure virtual

Member Data Documentation

◆ @171345153212031226005235253135311266336101016215

union { ... } blender::gpu::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 51 of file GPU_index_buffer.hh.

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

◆ index_len_

◆ 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 47 of file GPU_index_buffer.hh.

Referenced by index_start_get(), init(), init_build_on_device(), init_subrange(), and blender::gpu::GLIndexBuf::offset_ptr().

◆ index_type_

◆ is_empty_

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

True if buffer only contains restart indices.

Definition at line 57 of file GPU_index_buffer.hh.

Referenced by index_len_get(), and init().

◆ is_init_

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

Bookkeeping.

Definition at line 53 of file GPU_index_buffer.hh.

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

◆ is_subrange_


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