|
Blender V4.3
|
#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 () | |
| 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 | 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 | |
| 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 { | ||
| void * data_ = nullptr | ||
| IndexBuf * src_ | ||
| }; | ||
Definition at line 20 of file mtl_index_buffer.hh.
| blender::gpu::MTLIndexBuf::~MTLIndexBuf | ( | ) |
Definition at line 22 of file mtl_index_buffer.mm.
References blender::gpu::MTLBuffer::free(), and blender::gpu::IndexBuf::is_subrange_.
|
overridevirtual |
Implements blender::gpu::IndexBuf.
Definition at line 43 of file mtl_index_buffer.mm.
References blender::gpu::MTLStorageBuf::bind(), BLI_assert, ceil_to_multiple_u(), flag_can_optimize(), MTLStorageBuf, and upload_data().
| void blender::gpu::MTLIndexBuf::flag_can_optimize | ( | bool | can_optimize | ) |
Definition at line 212 of file mtl_index_buffer.mm.
References BLI_assert_msg.
Referenced by bind_as_ssbo(), and update_sub().
| id< MTLBuffer > blender::gpu::MTLIndexBuf::get_index_buffer | ( | GPUPrimType & | in_out_primitive_type, |
| uint & | in_out_v_count ) |
Definition at line 343 of file mtl_index_buffer.mm.
References blender::gpu::MTLBufferPool::allocate(), BLI_assert, BLI_assert_msg, BLI_assert_unreachable, blender::gpu::MTLBuffer::flush(), blender::gpu::MTLBuffer::free(), blender::gpu::MTLContext::get_global_memory_manager(), blender::gpu::MTLBuffer::get_host_ptr(), blender::gpu::MTLBuffer::get_metal_buffer(), blender::gpu::GPU_INDEX_U16, GPU_PRIM_LINE_LOOP, GPU_PRIM_LINE_STRIP, GPU_PRIM_LINES, GPU_PRIM_POINTS, GPU_PRIM_TRI_FAN, GPU_PRIM_TRI_STRIP, GPU_PRIM_TRIS, blender::gpu::IndexBuf::index_len_, blender::gpu::IndexBuf::index_type_, blender::gpu::IndexBuf::is_subrange_, MTL_LOG_INFO, MTL_LOG_WARNING, blender::gpu::populate_emulated_tri_fan_buf(), blender::gpu::populate_optimized_tri_strip_buf(), and upload_data().
Referenced by blender::gpu::MTLBatch::bind(), and blender::gpu::MTLDrawList::submit().
|
inlinestatic |
Definition at line 75 of file mtl_index_buffer.hh.
References blender::gpu::GPU_INDEX_U16.
Referenced by blender::gpu::MTLDrawList::submit().
|
overridevirtual |
Implements blender::gpu::IndexBuf.
Definition at line 65 of file mtl_index_buffer.mm.
References BLI_assert, blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder(), blender::gpu::MTLContext::get(), blender::gpu::MTLBuffer::get_host_ptr(), blender::gpu::MTLBuffer::get_metal_buffer(), GPU_finish(), blender::gpu::MTLContext::main_command_buffer, and blender::gpu::IndexBuf::size_get().
|
overridevirtual |
Implements blender::gpu::IndexBuf.
Definition at line 148 of file mtl_index_buffer.mm.
References BLI_assert, blender::gpu::IndexBuf::data_, blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder(), flag_can_optimize(), blender::gpu::MTLBuffer::free(), blender::gpu::MTLContext::get(), blender::gpu::MTLBuffer::get_metal_buffer(), blender::gpu::MTLContext::get_scratchbuffer_manager(), blender::gpu::IndexBuf::is_subrange_, len, blender::gpu::MTLContext::main_command_buffer, ptr, blender::gpu::MTLScratchBufferManager::scratch_buffer_allocate_range(), size(), and blender::gpu::IndexBuf::size_get().
|
overridevirtual |
Implements blender::gpu::IndexBuf.
Definition at line 90 of file mtl_index_buffer.mm.
References blender::gpu::MTLBufferPool::allocate(), blender::gpu::MTLBufferPool::allocate_with_data(), BLI_assert, BLI_assert_msg, blender::gpu::IndexBuf::data_, blender::gpu::MTLBuffer::free(), blender::gpu::MTLContext::get_global_memory_manager(), blender::gpu::IndexBuf::is_subrange_, MEM_SAFE_FREE, MTL_LOG_INFO, MTL_LOG_WARNING, blender::gpu::MTLBuffer::set_label(), blender::gpu::IndexBuf::size_get(), blender::gpu::IndexBuf::src_, and upload_data().
Referenced by blender::gpu::MTLBatch::bind(), bind_as_ssbo(), get_index_buffer(), and upload_data().
|
friend |
Definition at line 21 of file mtl_index_buffer.hh.
|
friend |
Definition at line 22 of file mtl_index_buffer.hh.
|
friend |
Definition at line 23 of file mtl_index_buffer.hh.
Referenced by bind_as_ssbo().