|
Blender V4.3
|
#include <mtl_uniform_buffer.hh>
Inherits blender::gpu::UniformBuf.
Public Member Functions | |
| MTLUniformBuf (size_t size, const char *name) | |
| ~MTLUniformBuf () | |
| void | update (const void *data) override |
| void | bind (int slot) override |
| void | bind_as_ssbo (int slot) override |
| void | unbind () override |
| void | clear_to_zero () override |
| id< MTLBuffer > | get_metal_buffer () |
| size_t | get_size () |
| const char * | get_name () |
| MEM_CXX_CLASS_ALLOC_FUNCS ("MTLUniformBuf") | |
Public Member Functions inherited from blender::gpu::UniformBuf | |
| UniformBuf (size_t size, const char *name) | |
| virtual | ~UniformBuf () |
| void | attach_data (void *data) |
Friends | |
| class | MTLStorageBuf |
Additional Inherited Members | |
Protected Attributes inherited from blender::gpu::UniformBuf | |
| size_t | size_in_bytes_ |
| void * | data_ = nullptr |
| char | name_ [DEBUG_NAME_LEN] |
Implementation of Uniform Buffers using Metal.
Definition at line 23 of file mtl_uniform_buffer.hh.
| blender::gpu::MTLUniformBuf::MTLUniformBuf | ( | size_t | size, |
| const char * | name ) |
Definition at line 24 of file mtl_uniform_buffer.mm.
| blender::gpu::MTLUniformBuf::~MTLUniformBuf | ( | ) |
Definition at line 26 of file mtl_uniform_buffer.mm.
References blender::gpu::MTLUniformBufferBinding::bound, blender::gpu::MTLBuffer::free(), blender::gpu::MTLContext::get(), MTL_MAX_BUFFER_BINDINGS, blender::gpu::MTLContext::pipeline_state, blender::gpu::MTLUniformBufferBinding::ubo, and blender::gpu::MTLContextGlobalShaderPipelineState::ubo_bindings.
|
overridevirtual |
Implements blender::gpu::UniformBuf.
Definition at line 100 of file mtl_uniform_buffer.mm.
References BLI_assert, blender::gpu::MTLUniformBufferBinding::bound, blender::gpu::UniformBuf::data_, blender::gpu::MTLContext::get(), MEM_SAFE_FREE, MTL_LOG_WARNING, MTL_MAX_BUFFER_BINDINGS, blender::gpu::MTLContext::pipeline_state, blender::gpu::MTLUniformBufferBinding::ubo, blender::gpu::MTLContextGlobalShaderPipelineState::ubo_bindings, and update().
|
overridevirtual |
Implements blender::gpu::UniformBuf.
Definition at line 132 of file mtl_uniform_buffer.mm.
References blender::gpu::MTLStorageBuf::bind(), clear_to_zero(), blender::gpu::UniformBuf::data_, MEM_SAFE_FREE, MTL_LOG_WARNING, MTLStorageBuf, blender::gpu::UniformBuf::size_in_bytes_, and update().
|
overridevirtual |
Implements blender::gpu::UniformBuf.
Definition at line 92 of file mtl_uniform_buffer.mm.
References free(), blender::gpu::UniformBuf::size_in_bytes_, and update().
Referenced by bind_as_ssbo().
| id< MTLBuffer > blender::gpu::MTLUniformBuf::get_metal_buffer | ( | ) |
Definition at line 185 of file mtl_uniform_buffer.mm.
References BLI_assert, blender::gpu::MTLBuffer::debug_ensure_used(), and blender::gpu::MTLBuffer::get_metal_buffer().
Referenced by blender::gpu::MTLContext::ensure_buffer_bindings(), and blender::gpu::MTLContext::ensure_buffer_bindings().
|
inline |
Definition at line 53 of file mtl_uniform_buffer.hh.
References blender::gpu::UniformBuf::name_.
| size_t blender::gpu::MTLUniformBuf::get_size | ( | ) |
Definition at line 195 of file mtl_uniform_buffer.mm.
References BLI_assert, and blender::gpu::UniformBuf::size_in_bytes_.
Referenced by blender::gpu::MTLContext::ensure_buffer_bindings(), and blender::gpu::MTLContext::ensure_buffer_bindings().
| blender::gpu::MTLUniformBuf::MEM_CXX_CLASS_ALLOC_FUNCS | ( | "MTLUniformBuf" | ) |
|
overridevirtual |
Implements blender::gpu::UniformBuf.
Definition at line 160 of file mtl_uniform_buffer.mm.
References blender::gpu::MTLUniformBufferBinding::bound, G, G_DEBUG_GPU, blender::gpu::MTLContext::pipeline_state, blender::gpu::MTLUniformBufferBinding::ubo, and blender::gpu::MTLContextGlobalShaderPipelineState::ubo_bindings.
|
overridevirtual |
Implements blender::gpu::UniformBuf.
Definition at line 54 of file mtl_uniform_buffer.mm.
References blender::gpu::MTLBufferPool::allocate_with_data(), BLI_assert, blender::gpu::MTLContext::device, blender::gpu::MTLBuffer::free(), blender::gpu::MTLContext::get(), blender::gpu::MTLContext::get_global_memory_manager(), blender::gpu::MTLBuffer::get_metal_buffer(), blender::gpu::UniformBuf::name_, blender::gpu::MTLBuffer::set_label(), blender::gpu::UniformBuf::size_in_bytes_, and UNUSED_VARS_NDEBUG.
Referenced by bind(), bind_as_ssbo(), and clear_to_zero().
|
friend |
Definition at line 24 of file mtl_uniform_buffer.hh.
Referenced by bind_as_ssbo().