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

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

Issue 1806983002: Update how we send draws to gpu backend to reduce state setting. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 4 years, 9 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/glsl/GrGLSLProgramBuilder.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 "GrVkCaps.h" 13 #include "GrVkCaps.h"
14 #include "GrVkIndexBuffer.h" 14 #include "GrVkIndexBuffer.h"
15 #include "GrVkProgram.h" 15 #include "GrVkProgram.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 "vulkan/vulkan.h" 21 #include "vulkan/vulkan.h"
22 22
23 class GrPipeline; 23 class GrPipeline;
24 class GrNonInstancedVertices; 24 class GrNonInstancedMesh;
25 25
26 class GrVkBufferImpl; 26 class GrVkBufferImpl;
27 class GrVkCommandBuffer; 27 class GrVkCommandBuffer;
28 class GrVkPipeline; 28 class GrVkPipeline;
29 class GrVkRenderPass; 29 class GrVkRenderPass;
30 class GrVkTexture; 30 class GrVkTexture;
31 struct GrVkInterface; 31 struct GrVkInterface;
32 32
33 class GrVkGpu : public GrGpu { 33 class GrVkGpu : public GrGpu {
34 public: 34 public:
(...skipping 22 matching lines...) Expand all
57 }; 57 };
58 58
59 bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeigh t, size_t rowBytes, 59 bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeigh t, size_t rowBytes,
60 GrPixelConfig readConfig, DrawPreference*, 60 GrPixelConfig readConfig, DrawPreference*,
61 ReadPixelTempDrawInfo*) override; 61 ReadPixelTempDrawInfo*) override;
62 62
63 bool onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, 63 bool onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height,
64 GrPixelConfig srcConfig, DrawPreference*, 64 GrPixelConfig srcConfig, DrawPreference*,
65 WritePixelTempDrawInfo*) override; 65 WritePixelTempDrawInfo*) override;
66 66
67 void buildProgramDesc(GrProgramDesc*, const GrPrimitiveProcessor&,
68 const GrPipeline&) const override;
69
70 void discard(GrRenderTarget*) override { 67 void discard(GrRenderTarget*) override {
71 SkDebugf("discard not yet implemented for Vulkan\n"); 68 SkDebugf("discard not yet implemented for Vulkan\n");
72 } 69 }
73 70
74 bool onCopySurface(GrSurface* dst, 71 bool onCopySurface(GrSurface* dst,
75 GrSurface* src, 72 GrSurface* src,
76 const SkIRect& srcRect, 73 const SkIRect& srcRect,
77 const SkIPoint& dstPoint) override; 74 const SkIPoint& dstPoint) override;
78 75
79 void onGetMultisampleSpecs(GrRenderTarget* rt, 76 void onGetMultisampleSpecs(GrRenderTarget* rt,
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 144 }
148 145
149 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override; 146 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override;
150 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override; 147 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override;
151 GrTransferBuffer* onCreateTransferBuffer(size_t size, TransferType type) ove rride; 148 GrTransferBuffer* onCreateTransferBuffer(size_t size, TransferType type) ove rride;
152 149
153 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override; 150 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override;
154 151
155 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli p) override; 152 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli p) override;
156 153
157 void onDraw(const DrawArgs&, const GrNonInstancedVertices&) override; 154 void onDraw(const GrPipeline&,
155 const GrPrimitiveProcessor&,
156 const GrMesh*,
157 int meshCount) override;
158 158
159 bool onReadPixels(GrSurface* surface, 159 bool onReadPixels(GrSurface* surface,
160 int left, int top, int width, int height, 160 int left, int top, int width, int height,
161 GrPixelConfig, 161 GrPixelConfig,
162 void* buffer, 162 void* buffer,
163 size_t rowBytes) override; 163 size_t rowBytes) override;
164 164
165 bool onWritePixels(GrSurface* surface, 165 bool onWritePixels(GrSurface* surface,
166 int left, int top, int width, int height, 166 int left, int top, int width, int height,
167 GrPixelConfig config, const SkTArray<GrMipLevel>&) overri de; 167 GrPixelConfig config, const SkTArray<GrMipLevel>&) overri de;
168 168
169 bool onTransferPixels(GrSurface*, 169 bool onTransferPixels(GrSurface*,
170 int left, int top, int width, int height, 170 int left, int top, int width, int height,
171 GrPixelConfig config, GrTransferBuffer* buffer, 171 GrPixelConfig config, GrTransferBuffer* buffer,
172 size_t offset, size_t rowBytes) override { 172 size_t offset, size_t rowBytes) override {
173 SkDebugf("onTransferPixels not yet implemented for Vulkan\n"); 173 SkDebugf("onTransferPixels not yet implemented for Vulkan\n");
174 return false; 174 return false;
175 } 175 }
176 176
177 void onResolveRenderTarget(GrRenderTarget* target) override { 177 void onResolveRenderTarget(GrRenderTarget* target) override {
178 SkDebugf("onResolveRenderTarget not yet implemented for Vulkan\n"); 178 SkDebugf("onResolveRenderTarget not yet implemented for Vulkan\n");
179 } 179 }
180 180
181 bool prepareDrawState(const GrPipeline&,
182 const GrPrimitiveProcessor&,
183 GrPrimitiveType,
184 const GrVkRenderPass&,
185 GrVkProgram** program);
186
181 // Bind vertex and index buffers 187 // Bind vertex and index buffers
182 void bindGeometry(const GrPrimitiveProcessor&, const GrNonInstancedVertices& ); 188 void bindGeometry(const GrPrimitiveProcessor&, const GrNonInstancedMesh&);
183 189
184 // Ends and submits the current command buffer to the queue and then creates a new command 190 // Ends and submits the current command buffer to the queue and then creates a new command
185 // buffer and begins it. If sync is set to kForce_SyncQueue, the function wi ll wait for all 191 // buffer and begins it. If sync is set to kForce_SyncQueue, the function wi ll wait for all
186 // work in the queue to finish before returning. 192 // work in the queue to finish before returning.
187 void submitCommandBuffer(SyncQueue sync); 193 void submitCommandBuffer(SyncQueue sync);
188 194
189 void copySurfaceAsCopyImage(GrSurface* dst, 195 void copySurfaceAsCopyImage(GrSurface* dst,
190 GrSurface* src, 196 GrSurface* src,
191 const SkIRect& srcRect, 197 const SkIRect& srcRect,
192 const SkIPoint& dstPoint); 198 const SkIPoint& dstPoint);
(...skipping 24 matching lines...) Expand all
217 shaderc_compiler_t fCompiler; 223 shaderc_compiler_t fCompiler;
218 224
219 // This is only for our current testing and building. The client should be h olding on to the 225 // This is only for our current testing and building. The client should be h olding on to the
220 // VkInstance. 226 // VkInstance.
221 VkInstance fVkInstance; 227 VkInstance fVkInstance;
222 228
223 typedef GrGpu INHERITED; 229 typedef GrGpu INHERITED;
224 }; 230 };
225 231
226 #endif 232 #endif
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramBuilder.cpp ('k') | src/gpu/vk/GrVkGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698