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>
36 mutable RWMutex libraries_mutex_;
37 NSMutableArray<id<MTLLibrary>>* libraries_
IPLR_GUARDED_BY(libraries_mutex_) =
40 bool is_valid_ =
false;
45 std::shared_ptr<const ShaderFunction> GetFunction(std::string_view name,
49 void RegisterFunction(std::string name,
51 std::shared_ptr<fml::Mapping> code,
55 void UnregisterFunction(std::string name,
ShaderStage stage)
override;
57 id<MTLDevice> GetDevice()
const;
59 void RegisterLibrary(id<MTLLibrary> library);
std::function< void(bool)> RegistrationCallback
~ShaderLibraryMTL() override
bool IsValid() const override
std::unordered_map< ShaderKey, std::shared_ptr< const ShaderFunction >, ShaderKey::Hash, ShaderKey::Equal > ShaderFunctionMap
#define IPLR_GUARDED_BY(x)