Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: src/gpu/vk/GrVkGpu.h

Issue 2038583002: Add GpuCommandBuffer support. (Closed) Base URL: https://skia.googlesource.com/skia.git@secondaryCB
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/vk/GrVkCommandBuffer.cpp ('k') | src/gpu/vk/GrVkGpu.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrVkGpu_DEFINED 8 #ifndef GrVkGpu_DEFINED
9 #define GrVkGpu_DEFINED 9 #define GrVkGpu_DEFINED
10 10
11 #include "GrGpu.h" 11 #include "GrGpu.h"
12 #include "GrGpuFactory.h" 12 #include "GrGpuFactory.h"
13 #include "vk/GrVkBackendContext.h" 13 #include "vk/GrVkBackendContext.h"
14 #include "GrVkCaps.h" 14 #include "GrVkCaps.h"
15 #include "GrVkIndexBuffer.h" 15 #include "GrVkIndexBuffer.h"
16 #include "GrVkResourceProvider.h" 16 #include "GrVkResourceProvider.h"
17 #include "GrVkVertexBuffer.h" 17 #include "GrVkVertexBuffer.h"
18 #include "GrVkUtil.h" 18 #include "GrVkUtil.h"
19 19
20 #include "shaderc/shaderc.h" 20 #include "shaderc/shaderc.h"
21 #include "vk/GrVkDefines.h" 21 #include "vk/GrVkDefines.h"
22 22
23 class GrPipeline; 23 class GrPipeline;
24 class GrNonInstancedMesh; 24 class GrNonInstancedMesh;
25 25
26 class GrVkBufferImpl; 26 class GrVkBufferImpl;
27 class GrVkCommandBuffer;
28 class GrVkPipeline; 27 class GrVkPipeline;
29 class GrVkPipelineState; 28 class GrVkPipelineState;
29 class GrVkPrimaryCommandBuffer;
30 class GrVkRenderPass; 30 class GrVkRenderPass;
31 class GrVkSecondaryCommandBuffer;
31 class GrVkTexture; 32 class GrVkTexture;
32 struct GrVkInterface; 33 struct GrVkInterface;
33 34
34 class GrVkGpu : public GrGpu { 35 class GrVkGpu : public GrGpu {
35 public: 36 public:
36 static GrGpu* Create(GrBackendContext backendContext, const GrContextOptions & options, 37 static GrGpu* Create(GrBackendContext backendContext, const GrContextOptions & options,
37 GrContext* context); 38 GrContext* context);
38 39
39 ~GrVkGpu() override; 40 ~GrVkGpu() override;
40 41
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 GrPixelConfig config) overri de; 84 GrPixelConfig config) overri de;
84 bool isTestingOnlyBackendTexture(GrBackendObject id) const override; 85 bool isTestingOnlyBackendTexture(GrBackendObject id) const override;
85 void deleteTestingOnlyBackendTexture(GrBackendObject id, bool abandonTexture ) override; 86 void deleteTestingOnlyBackendTexture(GrBackendObject id, bool abandonTexture ) override;
86 87
87 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa rget*, 88 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa rget*,
88 int width, 89 int width,
89 int height) over ride; 90 int height) over ride;
90 91
91 void clearStencil(GrRenderTarget* target) override; 92 void clearStencil(GrRenderTarget* target) override;
92 93
94 GrGpuCommandBuffer* createCommandBuffer(const GrRenderTarget& target,
95 GrGpuCommandBuffer::LoadAndStoreOp c olorOp,
96 GrColor colorClear,
97 GrGpuCommandBuffer::LoadAndStoreOp s tencilOp,
98 GrColor stencilClear) override;
99
93 void drawDebugWireRect(GrRenderTarget*, const SkIRect&, GrColor) override {} 100 void drawDebugWireRect(GrRenderTarget*, const SkIRect&, GrColor) override {}
94 101
95 void addMemoryBarrier(VkPipelineStageFlags srcStageMask, 102 void addMemoryBarrier(VkPipelineStageFlags srcStageMask,
96 VkPipelineStageFlags dstStageMask, 103 VkPipelineStageFlags dstStageMask,
97 bool byRegion, 104 bool byRegion,
98 VkMemoryBarrier* barrier) const; 105 VkMemoryBarrier* barrier) const;
99 void addBufferMemoryBarrier(VkPipelineStageFlags srcStageMask, 106 void addBufferMemoryBarrier(VkPipelineStageFlags srcStageMask,
100 VkPipelineStageFlags dstStageMask, 107 VkPipelineStageFlags dstStageMask,
101 bool byRegion, 108 bool byRegion,
102 VkBufferMemoryBarrier* barrier) const; 109 VkBufferMemoryBarrier* barrier) const;
103 void addImageMemoryBarrier(VkPipelineStageFlags srcStageMask, 110 void addImageMemoryBarrier(VkPipelineStageFlags srcStageMask,
104 VkPipelineStageFlags dstStageMask, 111 VkPipelineStageFlags dstStageMask,
105 bool byRegion, 112 bool byRegion,
106 VkImageMemoryBarrier* barrier) const; 113 VkImageMemoryBarrier* barrier) const;
107 114
108 shaderc_compiler_t shadercCompiler() const { 115 shaderc_compiler_t shadercCompiler() const {
109 return fCompiler; 116 return fCompiler;
110 } 117 }
111 118
119 void submitSecondaryCommandBuffer(const GrVkSecondaryCommandBuffer*);
120
112 void finishDrawTarget() override; 121 void finishDrawTarget() override;
113 122
114 void generateMipmap(GrVkTexture* tex) const; 123 void generateMipmap(GrVkTexture* tex) const;
115 124
116 private: 125 private:
117 GrVkGpu(GrContext* context, const GrContextOptions& options, 126 GrVkGpu(GrContext* context, const GrContextOptions& options,
118 const GrVkBackendContext* backendContext); 127 const GrVkBackendContext* backendContext);
119 128
120 void onResetContext(uint32_t resetBits) override {} 129 void onResetContext(uint32_t resetBits) override {}
121 130
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 233
225 // Shaderc compiler used for compiling glsl in spirv. We only want to create the compiler once 234 // Shaderc compiler used for compiling glsl in spirv. We only want to create the compiler once
226 // since there is significant overhead to the first compile of any compiler. 235 // since there is significant overhead to the first compile of any compiler.
227 shaderc_compiler_t fCompiler; 236 shaderc_compiler_t fCompiler;
228 237
229 238
230 typedef GrGpu INHERITED; 239 typedef GrGpu INHERITED;
231 }; 240 };
232 241
233 #endif 242 #endif
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkCommandBuffer.cpp ('k') | src/gpu/vk/GrVkGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698