100void ShaderLibraryMTL::RegisterFunction(std::string
name,
102 std::shared_ptr<fml::Mapping> code,
107 auto failure_callback = std::make_shared<fml::ScopedCleanupClosure>(
112 if (code ==
nullptr || code->GetMapping() ==
nullptr) {
115 auto device = GetDevice();
120 auto source = [[NSString alloc] initWithBytes:code->GetMapping()
122 encoding:NSUTF8StringEncoding];
124 auto weak_this = weak_from_this();
127 completionHandler:^(id<MTLLibrary> library, NSError*
error) {
128 auto strong_this = weak_this.lock();
131 "dynamic shader stage could be registered.";
136 <<
error.localizedDescription.UTF8String;
140 ->RegisterLibrary(library);
141 failure_callback->Release();
const uint8_t uint32_t uint32_t GError ** error