5 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SHADER_LIBRARY_MTL_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SHADER_LIBRARY_MTL_H_
8 #include <Foundation/Foundation.h>
9 #include <Metal/Metal.h>
13 #include <unordered_map>
15 #include "flutter/fml/macros.h"
37 mutable RWMutex libraries_mutex_;
38 NSMutableArray<id<MTLLibrary>>* libraries_
IPLR_GUARDED_BY(libraries_mutex_) =
41 bool is_valid_ =
false;
46 std::shared_ptr<const ShaderFunction> GetFunction(std::string_view name,
50 void RegisterFunction(std::string name,
52 std::shared_ptr<fml::Mapping> code,
56 void UnregisterFunction(std::string name,
ShaderStage stage)
override;
58 id<MTLDevice> GetDevice()
const;
60 void RegisterLibrary(id<MTLLibrary> library);
69 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SHADER_LIBRARY_MTL_H_