Timothy Liang | e30739a | 2018-07-31 10:51:17 -0400 | [diff] [blame] | 1 | /* |
| 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 | |
| 13 | class GrMtlGpu; |
| 14 | |
| 15 | class GrMtlCopyPipelineState { |
| 16 | public: |
| 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 | |
| 25 | private: |
| 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 |