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>
10 #include "flutter/fml/macros.h"
36 void SetEncoder(id<MTLComputeCommandEncoder> encoder);
40 void SetTexture(uint64_t index, id<MTLTexture> texture);
42 void SetSampler(uint64_t index, id<MTLSamplerState> sampler);
45 struct BufferOffsetPair {
46 id<MTLBuffer> buffer =
nullptr;
49 using BufferMap = std::map<uint64_t, BufferOffsetPair>;
50 using TextureMap = std::map<uint64_t, id<MTLTexture>>;
51 using SamplerMap = std::map<uint64_t, id<MTLSamplerState>>;
53 id<MTLComputeCommandEncoder> encoder_;
54 id<MTLComputePipelineState> pipeline_ =
nullptr;
62 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_COMPUTE_PASS_BINDINGS_CACHE_MTL_H_