• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 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 GrVkMSAALoadManager_DEFINED
9 #define GrVkMSAALoadManager_DEFINED
10 
11 #include "include/gpu/GrTypes.h"
12 #include "include/gpu/vk/GrVkTypes.h"
13 #include "src/gpu/GrNativeRect.h"
14 #include "src/gpu/vk/GrVkDescriptorSetManager.h"
15 
16 class GrAttachment;
17 class GrSurface;
18 class GrVkAttachment;
19 class GrVkCommandBuffer;
20 class GrVkGpu;
21 class GrVkRenderPass;
22 struct SkIRect;
23 
24 class GrVkMSAALoadManager {
25 public:
26     GrVkMSAALoadManager();
27 
28     ~GrVkMSAALoadManager();
29 
30     bool loadMSAAFromResolve(GrVkGpu* gpu,
31                              GrVkCommandBuffer* commandBuffer,
32                              const GrVkRenderPass& renderPass,
33                              GrAttachment* dst,
34                              GrVkAttachment* src,
35                              const SkIRect& srcRect);
36 
37     void destroyResources(GrVkGpu* gpu);
38 
39 private:
40     bool createMSAALoadProgram(GrVkGpu* gpu);
41 
42     // Everything below is only created once and shared by all msaa load pipelines
43     VkShaderModule fVertShaderModule;
44     VkShaderModule fFragShaderModule;
45     VkPipelineShaderStageCreateInfo fShaderStageInfo[2];
46 
47     // All pipelines used by this class use the same VkPipelineLayout. Therefore, unlike regular
48     // GrVkPipelines, we have the manager own the layout instead of the GrVkPipeline.
49     VkPipelineLayout fPipelineLayout;
50 };
51 
52 #endif
53 
54