Blender V5.3
blender::gpu::MTLIndexBuf Class Reference

#include <mtl_index_buffer.hh>

Inherits blender::gpu::IndexBuf.

Static Public Member Functions

static MTLIndexType gpu_index_type_to_metal (GPUIndexBufType type)

Friends

class MTLBatch
class MTLDrawList
class MTLStorageBuf

Core MTLIndexBuf implementation.

 ~MTLIndexBuf () override
void bind_as_ssbo (uint32_t binding) override
void read (uint32_t *data) const override
void upload_data () override
void update_sub (uint32_t start, uint32_t len, const void *data) override
void copy_sub (IndexBuf &source_buf, uint source_first_index, uint dest_first_index, uint index_len) override
 Copy part of source index buffer into this index buffer.
void flag_can_optimize (bool can_optimize)

Index buffer optimization and topology emulation

Index buffer optimization and emulation. Optimize index buffers by eliminating restart-indices. Emulate unsupported index types e.g. Triangle Fan and Line Loop.

id< MTLBuffer > get_index_buffer (GPUPrimType &in_out_primitive_type, uint &in_out_v_count)

Additional Inherited Members

Public Member Functions inherited from blender::gpu::IndexBuf
 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
Protected Attributes inherited from blender::gpu::IndexBuf
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

Definition at line 22 of file mtl_index_buffer.hh.

Constructor & Destructor Documentation

◆ ~MTLIndexBuf()

blender::gpu::MTLIndexBuf::~MTLIndexBuf ( )
override

Definition at line 22 of file mtl_index_buffer.mm.

References blender::gpu::IndexBuf::is_subrange_.

Member Function Documentation

◆ bind_as_ssbo()

void blender::gpu::MTLIndexBuf::bind_as_ssbo ( uint32_t binding)
overridevirtual

◆ copy_sub()

void blender::gpu::MTLIndexBuf::copy_sub ( IndexBuf & source_buf,
uint source_first_index,
uint dest_first_index,
uint index_len )
overridevirtual

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.

Implements blender::gpu::IndexBuf.

Definition at line 214 of file mtl_index_buffer.mm.

References blender::BLI_assert(), BLI_assert_msg, blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder(), flag_can_optimize(), blender::gpu::MTLContext::get(), blender::gpu::MTLBuffer::get_metal_buffer(), blender::gpu::IndexBuf::index_len_, blender::gpu::IndexBuf::index_type_, blender::gpu::IndexBuf::IndexBuf(), blender::gpu::IndexBuf::is_subrange_, blender::gpu::MTLContext::main_command_buffer, and blender::gpu::to_bytesize().

Referenced by MTLStorageBuf.

◆ flag_can_optimize()

void blender::gpu::MTLIndexBuf::flag_can_optimize ( bool can_optimize)

Definition at line 270 of file mtl_index_buffer.mm.

References BLI_assert_msg.

Referenced by bind_as_ssbo(), copy_sub(), MTLStorageBuf, and update_sub().

◆ get_index_buffer()

◆ gpu_index_type_to_metal()

MTLIndexType blender::gpu::MTLIndexBuf::gpu_index_type_to_metal ( GPUIndexBufType type)
inlinestatic

Definition at line 82 of file mtl_index_buffer.hh.

References blender::gpu::GPU_INDEX_U16.

◆ read()

◆ update_sub()

◆ upload_data()

◆ MTLBatch

friend class MTLBatch
friend

Definition at line 23 of file mtl_index_buffer.hh.

References MTLBatch.

Referenced by MTLBatch.

◆ MTLDrawList

friend class MTLDrawList
friend

Definition at line 24 of file mtl_index_buffer.hh.

References MTLDrawList.

Referenced by MTLDrawList.

◆ MTLStorageBuf


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