|
Blender V4.3
|
#include <mtl_vertex_buffer.hh>
Inherits blender::gpu::VertBuf.
Public Member Functions | |
| MTLVertBuf () | |
| ~MTLVertBuf () | |
| void | bind () |
| void | flag_used () |
| void | update_sub (uint start, uint len, const void *data) override |
| void | read (void *data) const override |
| void | wrap_handle (uint64_t handle) override |
Public Member Functions inherited from blender::gpu::VertBuf | |
| VertBuf () | |
| virtual | ~VertBuf () |
| void | init (const GPUVertFormat &format, GPUUsageType usage) |
| void | clear () |
| void | allocate (uint vert_len) |
| void | resize (uint vert_len) |
| void | upload () |
| VertBuf * | duplicate () |
| size_t | size_alloc_get () const |
| size_t | size_used_get () const |
| void | reference_add () |
| void | reference_remove () |
| GPUUsageType | get_usage_type () const |
| template<typename T > | |
| MutableSpan< T > | data () |
Protected Member Functions | |
| void | acquire_data () override |
| void | resize_data () override |
| void | release_data () override |
| void | upload_data () override |
| void | duplicate_data (VertBuf *dst) override |
| void | bind_as_ssbo (uint binding) override |
| void | bind_as_texture (uint binding) override |
| MEM_CXX_CLASS_ALLOC_FUNCS ("MTLVertBuf") | |
Friends | |
| class | gpu::MTLTexture |
| class | MTLShader |
| class | MTLBatch |
| class | MTLContext |
| class | MTLStorageBuf |
Additional Inherited Members | |
Public Attributes inherited from blender::gpu::VertBuf | |
| GPUVertFormat | format = {} |
| uint | vertex_len = 0 |
| uint | vertex_alloc = 0 |
| GPUVertBufStatus | flag = GPU_VERTBUF_INVALID |
| GPUUsageType | extended_usage_ = GPU_USAGE_STATIC |
Static Public Attributes inherited from blender::gpu::VertBuf | |
| static size_t | memory_usage = 0 |
Protected Attributes inherited from blender::gpu::VertBuf | |
| uchar * | data_ = nullptr |
| GPUUsageType | usage_ = GPU_USAGE_STATIC |
Definition at line 22 of file mtl_vertex_buffer.hh.
| blender::gpu::MTLVertBuf::MTLVertBuf | ( | ) |
Definition at line 14 of file mtl_vertex_buffer.mm.
| blender::gpu::MTLVertBuf::~MTLVertBuf | ( | ) |
Definition at line 16 of file mtl_vertex_buffer.mm.
References release_data().
|
overrideprotectedvirtual |
Implements blender::gpu::VertBuf.
Definition at line 21 of file mtl_vertex_buffer.mm.
References blender::gpu::VertBuf::data_, GPU_USAGE_DEVICE_ONLY, MEM_mallocN, MEM_SAFE_FREE, blender::gpu::VertBuf::size_alloc_get(), and blender::gpu::VertBuf::usage_.
| void blender::gpu::MTLVertBuf::bind | ( | ) |
Definition at line 124 of file mtl_vertex_buffer.mm.
References blender::gpu::MTLBufferPool::allocate(), BLI_assert, blender::gpu::VertBuf::data_, blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder(), blender::gpu::VertBuf::flag, flag_used(), blender::gpu::MTLBuffer::flush_range(), blender::gpu::MTLBuffer::free(), blender::gpu::MTLContext::get(), blender::gpu::MTLContext::get_global_memory_manager(), blender::gpu::MTLBuffer::get_host_ptr(), blender::gpu::MTLBuffer::get_metal_buffer(), blender::gpu::MTLBuffer::get_size(), blender::gpu::VertBuf::get_usage_type(), GPU_USAGE_DEVICE_ONLY, GPU_USAGE_STATIC, GPU_VERTBUF_DATA_DIRTY, GPU_VERTBUF_DATA_UPLOADED, blender::gpu::MTLContext::main_command_buffer, max_ulul(), MEM_SAFE_FREE, min_ulul(), MTL_LOG_INFO, blender::gpu::MTLBuffer::set_label(), size(), blender::gpu::VertBuf::size_used_get(), and blender::gpu::VertBuf::usage_.
Referenced by blender::gpu::MTLBatch::bind(), bind_as_ssbo(), bind_as_texture(), blender::gpu::MTLStorageBuf::copy_sub(), duplicate_data(), blender::gpu::MTLContext::ensure_render_pipeline_state(), blender::gpu::MTLTexture::init_internal(), update_sub(), and upload_data().
|
overrideprotectedvirtual |
Implements blender::gpu::VertBuf.
Definition at line 301 of file mtl_vertex_buffer.mm.
References blender::gpu::MTLStorageBuf::bind(), bind(), ceil_to_multiple_u(), flag_used(), and MTLStorageBuf.
|
overrideprotectedvirtual |
Implements blender::gpu::VertBuf.
Definition at line 315 of file mtl_vertex_buffer.mm.
References bind(), BLI_assert, blender::gpu::MTLTexture::get_vertex_buffer(), GPU_texture_bind(), GPU_texture_create_from_vertbuf(), GPU_TEXTURE_FREE_SAFE, and blender::gpu::unwrap().
|
overrideprotectedvirtual |
Implements blender::gpu::VertBuf.
Definition at line 61 of file mtl_vertex_buffer.mm.
References blender::gpu::MTLBufferPool::allocate(), bind(), BLI_assert, blender::gpu::VertBuf::data_, blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder(), flag_used(), G, G_DEBUG_GPU, blender::gpu::MTLContext::get(), blender::gpu::MTLContext::get_global_memory_manager(), blender::gpu::MTLBuffer::get_metal_buffer(), blender::gpu::MTLBuffer::get_size(), blender::gpu::VertBuf::get_usage_type(), GPU_USAGE_DEVICE_ONLY, length(), blender::gpu::MTLContext::main_command_buffer, MEM_dupallocN, NULL, and size().
| void blender::gpu::MTLVertBuf::flag_used | ( | ) |
Definition at line 416 of file mtl_vertex_buffer.mm.
Referenced by blender::gpu::MTLBatch::bind(), bind(), bind_as_ssbo(), duplicate_data(), and blender::gpu::MTLTexture::init_internal().
|
protected |
|
overridevirtual |
Implements blender::gpu::VertBuf.
Definition at line 343 of file mtl_vertex_buffer.mm.
References blender::gpu::MTLBufferPool::allocate(), BLI_assert, blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder(), blender::gpu::MTLBuffer::free(), blender::gpu::MTLContext::get(), blender::gpu::MTLContext::get_global_memory_manager(), blender::gpu::MTLBuffer::get_host_ptr(), blender::gpu::MTLBuffer::get_metal_buffer(), GPU_finish(), GPU_USAGE_DEVICE_ONLY, blender::gpu::MTLContext::main_command_buffer, min_ulul(), size(), and blender::gpu::VertBuf::usage_.
|
overrideprotectedvirtual |
Implements blender::gpu::VertBuf.
Definition at line 43 of file mtl_vertex_buffer.mm.
References blender::gpu::VertBuf::data_, blender::gpu::MTLBuffer::free(), GPU_TEXTURE_FREE_SAFE, and MEM_SAFE_FREE.
Referenced by ~MTLVertBuf().
|
overrideprotectedvirtual |
Implements blender::gpu::VertBuf.
Definition at line 33 of file mtl_vertex_buffer.mm.
References blender::gpu::VertBuf::data_, GPU_USAGE_DEVICE_ONLY, MEM_reallocN, blender::gpu::VertBuf::size_alloc_get(), and blender::gpu::VertBuf::usage_.
|
overridevirtual |
Implements blender::gpu::VertBuf.
Definition at line 261 of file mtl_vertex_buffer.mm.
References bind(), BLI_assert, blender::gpu::MTLBufferRange::buffer_offset, blender::gpu::MTLBufferRange::data, blender::gpu::MTLContext::device, blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder(), blender::gpu::MTLContext::get(), blender::gpu::MTLBuffer::get_metal_buffer(), blender::gpu::MTLContext::get_scratchbuffer_manager(), blender::gpu::MTLBuffer::get_size(), len, blender::gpu::MTLContext::main_command_buffer, blender::gpu::MTLBufferRange::metal_buffer, blender::gpu::MTLScratchBufferManager::scratch_buffer_allocate_range_aligned(), and size().
|
overrideprotectedvirtual |
Implements blender::gpu::VertBuf.
Definition at line 119 of file mtl_vertex_buffer.mm.
References bind().
|
overridevirtual |
Implements blender::gpu::VertBuf.
Definition at line 401 of file mtl_vertex_buffer.mm.
References BLI_assert, blender::gpu::VertBuf::flag, and GPU_VERTBUF_DATA_UPLOADED.
|
friend |
Definition at line 23 of file mtl_vertex_buffer.hh.
|
friend |
Definition at line 25 of file mtl_vertex_buffer.hh.
|
friend |
Definition at line 26 of file mtl_vertex_buffer.hh.
|
friend |
Definition at line 24 of file mtl_vertex_buffer.hh.
|
friend |
Definition at line 27 of file mtl_vertex_buffer.hh.
Referenced by bind_as_ssbo().