aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/mtl/GrMtlCopyPipelineState.h
blob: ce4cbb2bf708058a5cc9a6c3f3af2fe944a76dcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * Copyright 2018 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrMtlCopyPipelineState_DEFINED
#define GrMtlCopyPipelineState_DEFINED

#import <metal/metal.h>

class GrMtlGpu;

class GrMtlCopyPipelineState {
public:
    static GrMtlCopyPipelineState* CreateCopyPipelineState(GrMtlGpu* gpu,
                                                           MTLPixelFormat dstPixelFormat,
                                                           id<MTLFunction> vertexFunction,
                                                           id<MTLFunction> fragmentFunction,
                                                           MTLVertexDescriptor* vertexDescriptor);

    id<MTLRenderPipelineState> mtlCopyPipelineState() { return fPipelineState; }

private:
    GrMtlCopyPipelineState(id<MTLRenderPipelineState> pipelineState,
                       MTLPixelFormat pixelFormat)
            : fPipelineState(pipelineState)
            , fPixelFormat(pixelFormat) {}

    id<MTLRenderPipelineState> fPipelineState;
    MTLPixelFormat fPixelFormat;

    friend class GrMtlCopyManager;
};

#endif