Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/metal/mtl_uniform_buffer.mm
| Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | void MTLUniformBuf::update(const void *data) | ||||
| /* Allocate MTL buffer */ | /* Allocate MTL buffer */ | ||||
| MTLContext *ctx = static_cast<MTLContext *>(unwrap(GPU_context_active_get())); | MTLContext *ctx = static_cast<MTLContext *>(unwrap(GPU_context_active_get())); | ||||
| BLI_assert(ctx); | BLI_assert(ctx); | ||||
| BLI_assert(ctx->device); | BLI_assert(ctx->device); | ||||
| UNUSED_VARS_NDEBUG(ctx); | UNUSED_VARS_NDEBUG(ctx); | ||||
| if (data != nullptr) { | if (data != nullptr) { | ||||
| metal_buffer_ = MTLContext::get_global_memory_manager().allocate_with_data( | metal_buffer_ = MTLContext::get_global_memory_manager()->allocate_with_data( | ||||
| size_in_bytes_, true, data); | size_in_bytes_, true, data); | ||||
| has_data_ = true; | has_data_ = true; | ||||
| metal_buffer_->set_label(@"Uniform Buffer"); | metal_buffer_->set_label(@"Uniform Buffer"); | ||||
| BLI_assert(metal_buffer_ != nullptr); | BLI_assert(metal_buffer_ != nullptr); | ||||
| BLI_assert(metal_buffer_->get_metal_buffer() != nil); | BLI_assert(metal_buffer_->get_metal_buffer() != nil); | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines | |||||