5 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_COMPUTE_PASS_BINDINGS_CACHE_MTL_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_COMPUTE_PASS_BINDINGS_CACHE_MTL_H_
8 #include <Metal/Metal.h>
35 void SetEncoder(id<MTLComputeCommandEncoder> encoder);
39 void SetTexture(uint64_t index, id<MTLTexture> texture);
41 void SetSampler(uint64_t index, id<MTLSamplerState> sampler);
44 struct BufferOffsetPair {
45 id<MTLBuffer> buffer =
nullptr;
48 using BufferMap = std::map<uint64_t, BufferOffsetPair>;
49 using TextureMap = std::map<uint64_t, id<MTLTexture>>;
50 using SamplerMap = std::map<uint64_t, id<MTLSamplerState>>;
52 id<MTLComputeCommandEncoder> encoder_;
53 id<MTLComputePipelineState> pipeline_ =
nullptr;
61 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_COMPUTE_PASS_BINDINGS_CACHE_MTL_H_