1 /*
2  * Copyright 2016 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 GrVkCopyPipeline_DEFINED
9 #define GrVkCopyPipeline_DEFINED
10 
11 #include "GrVkPipeline.h"
12 
13 class GrVkCopyPipeline : public GrVkPipeline {
14 public:
15     // We expect the passed in renderPass to be stored on the GrVkResourceProvider and not a local
16     // object of the client.
17     static GrVkCopyPipeline* Create(GrVkGpu* gpu,
18                                     VkPipelineShaderStageCreateInfo* shaderStageInfo,
19                                     VkPipelineLayout pipelineLayout,
20                                     int numSamples,
21                                     const GrVkRenderPass& renderPass,
22                                     VkPipelineCache cache);
23 
24     bool isCompatible(const GrVkRenderPass& rp) const;
25 
26 #ifdef SK_TRACE_VK_RESOURCES
dumpInfo()27     void dumpInfo() const override {
28         SkDebugf("GrVkCopyPipeline: %d (%d refs)\n", fPipeline, this->getRefCnt());
29     }
30 #endif
31 
32 private:
GrVkCopyPipeline(VkPipeline pipeline,const GrVkRenderPass * renderPass)33     GrVkCopyPipeline(VkPipeline pipeline, const GrVkRenderPass* renderPass)
34         : INHERITED(pipeline)
35         , fRenderPass(renderPass) {
36     }
37 
38     const GrVkRenderPass* fRenderPass;
39 
40     typedef GrVkPipeline INHERITED;
41 };
42 
43 #endif
44