Blender
V3.3
|
#include <mtl_uniform_buffer.hh>
Public Member Functions | |
MTLUniformBuf (size_t size, const char *name) | |
~MTLUniformBuf () | |
void | update (const void *data) override |
void | bind (int slot) override |
void | unbind () override |
id< MTLBuffer > | get_metal_buffer (int *r_offset) |
int | get_size () |
const char * | get_name () |
MEM_CXX_CLASS_ALLOC_FUNCS ("MTLUniformBuf") | |
![]() | |
UniformBuf (size_t size, const char *name) | |
virtual | ~UniformBuf () |
void | attach_data (void *data) |
Additional Inherited Members | |
![]() | |
size_t | size_in_bytes_ |
void * | data_ = nullptr |
char | name_ [DEBUG_NAME_LEN] |
Implementation of Uniform Buffers using Metal.
Definition at line 19 of file mtl_uniform_buffer.hh.
blender::gpu::MTLUniformBuf::MTLUniformBuf | ( | size_t | size, |
const char * | name | ||
) |
Definition at line 21 of file mtl_uniform_buffer.mm.
blender::gpu::MTLUniformBuf::~MTLUniformBuf | ( | ) |
Definition at line 25 of file mtl_uniform_buffer.mm.
References blender::gpu::MTLUniformBufferBinding::bound, blender::gpu::MTLBuffer::free(), blender::gpu::MTLContext::get(), MTL_MAX_UNIFORM_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 84 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_UNIFORM_BUFFER_BINDINGS, blender::gpu::MTLContext::pipeline_state, blender::gpu::MTLUniformBufferBinding::ubo, blender::gpu::MTLContextGlobalShaderPipelineState::ubo_bindings, and update().
Definition at line 141 of file mtl_uniform_buffer.mm.
References BLI_assert, blender::gpu::MTLBuffer::debug_ensure_used(), and blender::gpu::MTLBuffer::get_metal_buffer().
|
inline |
Definition at line 42 of file mtl_uniform_buffer.hh.
References blender::gpu::UniformBuf::name_.
int blender::gpu::MTLUniformBuf::get_size | ( | ) |
Definition at line 156 of file mtl_uniform_buffer.mm.
References BLI_assert, and blender::gpu::UniformBuf::size_in_bytes_.
blender::gpu::MTLUniformBuf::MEM_CXX_CLASS_ALLOC_FUNCS | ( | "MTLUniformBuf" | ) |
|
overridevirtual |
Implements blender::gpu::UniformBuf.
Definition at line 116 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.
Implements blender::gpu::UniformBuf.
Definition at line 48 of file mtl_uniform_buffer.mm.
References blender::gpu::MTLBufferPool::allocate_with_data(), BLI_assert, data, blender::gpu::MTLContext::device, blender::gpu::MTLBuffer::free(), blender::gpu::MTLContext::get_global_memory_manager(), blender::gpu::MTLBuffer::get_metal_buffer(), GPU_context_active_get(), blender::gpu::MTLBuffer::set_label(), blender::gpu::UniformBuf::size_in_bytes_, UNUSED_VARS_NDEBUG, and blender::gpu::unwrap().
Referenced by bind().