blob: ce4cbb2bf708058a5cc9a6c3f3af2fe944a76dcd [file] [log] [blame]
Timothy Liange30739a2018-07-31 10:51:17 -04001/*
2 * Copyright 2018 Google Inc.
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 GrMtlCopyPipelineState_DEFINED
9#define GrMtlCopyPipelineState_DEFINED
10
11#import <metal/metal.h>
12
13class GrMtlGpu;
14
15class GrMtlCopyPipelineState {
16public:
17 static GrMtlCopyPipelineState* CreateCopyPipelineState(GrMtlGpu* gpu,
18 MTLPixelFormat dstPixelFormat,
19 id<MTLFunction> vertexFunction,
20 id<MTLFunction> fragmentFunction,
21 MTLVertexDescriptor* vertexDescriptor);
22
23 id<MTLRenderPipelineState> mtlCopyPipelineState() { return fPipelineState; }
24
25private:
26 GrMtlCopyPipelineState(id<MTLRenderPipelineState> pipelineState,
27 MTLPixelFormat pixelFormat)
28 : fPipelineState(pipelineState)
29 , fPixelFormat(pixelFormat) {}
30
31 id<MTLRenderPipelineState> fPipelineState;
32 MTLPixelFormat fPixelFormat;
33
34 friend class GrMtlCopyManager;
35};
36
37#endif