Flutter Engine
The Flutter Engine
MtlComputePipeline.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef skgpu_graphite_MtlComputePipeline_DEFINED
9#define skgpu_graphite_MtlComputePipeline_DEFINED
10
14
15#import <Metal/Metal.h>
16
17namespace skgpu::graphite {
18
19class ComputePipelineDesc;
21class MtlSharedContext;
22
23class MtlComputePipeline final : public ComputePipeline {
24public:
25 using MSLFunction = std::pair<id<MTLLibrary>, std::string>;
26
28 const std::string& label,
29 MSLFunction computeMain);
30 ~MtlComputePipeline() override = default;
31
32 id<MTLComputePipelineState> mtlPipelineState() const { return fPipelineState.get(); }
33
34private:
35 MtlComputePipeline(const SharedContext* sharedContext, sk_cfp<id<MTLComputePipelineState>> pso)
37 , fPipelineState(std::move(pso)) {}
38
39 void freeGpuData() override;
40
41 sk_cfp<id<MTLComputePipelineState>> fPipelineState;
42};
43
44} // namespace skgpu::graphite
45
46#endif // skgpu_graphite_MtlComputePipeline_DEFINED
std::pair< id< MTLLibrary >, std::string > MSLFunction
static sk_sp< MtlComputePipeline > Make(const MtlSharedContext *, const std::string &label, MSLFunction computeMain)
id< MTLComputePipelineState > mtlPipelineState() const
~MtlComputePipeline() override=default
const SharedContext * sharedContext() const
Definition: Resource.h:189
Definition: ref_ptr.h:256