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

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

Issue 2078483002: Start using GrGpuCommandBuffer in GrDrawTarget. (Closed) Base URL: https://skia.googlesource.com/skia.git@memoryWAR
Patch Set: remove errant lines 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
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 }; 58 };
59 59
60 bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeigh t, size_t rowBytes, 60 bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeigh t, size_t rowBytes,
61 GrPixelConfig readConfig, DrawPreference*, 61 GrPixelConfig readConfig, DrawPreference*,
62 ReadPixelTempDrawInfo*) override; 62 ReadPixelTempDrawInfo*) override;
63 63
64 bool onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, 64 bool onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height,
65 GrPixelConfig srcConfig, DrawPreference*, 65 GrPixelConfig srcConfig, DrawPreference*,
66 WritePixelTempDrawInfo*) override; 66 WritePixelTempDrawInfo*) override;
67 67
68 void discard(GrRenderTarget*) override {}
69
70 bool onCopySurface(GrSurface* dst, 68 bool onCopySurface(GrSurface* dst,
71 GrSurface* src, 69 GrSurface* src,
72 const SkIRect& srcRect, 70 const SkIRect& srcRect,
73 const SkIPoint& dstPoint) override; 71 const SkIPoint& dstPoint) override;
74 72
75 void onGetMultisampleSpecs(GrRenderTarget* rt, 73 void onGetMultisampleSpecs(GrRenderTarget* rt,
76 const GrStencilSettings&, 74 const GrStencilSettings&,
77 int* effectiveSampleCnt, 75 int* effectiveSampleCnt,
78 SkAutoTDeleteArray<SkPoint>*) override; 76 SkAutoTDeleteArray<SkPoint>*) override;
79 77
80 bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) const override; 78 bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) const override;
81 79
82 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override {} 80 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override {}
83 81
84 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, 82 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h,
85 GrPixelConfig config) overri de; 83 GrPixelConfig config) overri de;
86 bool isTestingOnlyBackendTexture(GrBackendObject id) const override; 84 bool isTestingOnlyBackendTexture(GrBackendObject id) const override;
87 void deleteTestingOnlyBackendTexture(GrBackendObject id, bool abandonTexture ) override; 85 void deleteTestingOnlyBackendTexture(GrBackendObject id, bool abandonTexture ) override;
88 86
89 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa rget*, 87 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa rget*,
90 int width, 88 int width,
91 int height) over ride; 89 int height) over ride;
92 90
93 void clearStencil(GrRenderTarget* target) override; 91 void clearStencil(GrRenderTarget* target) override;
94 92
95 GrGpuCommandBuffer* createCommandBuffer(const GrRenderTarget& target, 93 GrGpuCommandBuffer* createCommandBuffer(
96 GrGpuCommandBuffer::LoadAndStoreOp c olorOp, 94 GrRenderTarget* target,
97 GrColor colorClear, 95 const GrGpuCommandBuffer::LoadAndStoreInfo& colorInfo,
98 GrGpuCommandBuffer::LoadAndStoreOp s tencilOp, 96 const GrGpuCommandBuffer::LoadAndStoreInfo& stencilInfo) override;
99 GrColor stencilClear) override;
100 97
101 void drawDebugWireRect(GrRenderTarget*, const SkIRect&, GrColor) override {} 98 void drawDebugWireRect(GrRenderTarget*, const SkIRect&, GrColor) override {}
102 99
103 void addMemoryBarrier(VkPipelineStageFlags srcStageMask, 100 void addMemoryBarrier(VkPipelineStageFlags srcStageMask,
104 VkPipelineStageFlags dstStageMask, 101 VkPipelineStageFlags dstStageMask,
105 bool byRegion, 102 bool byRegion,
106 VkMemoryBarrier* barrier) const; 103 VkMemoryBarrier* barrier) const;
107 void addBufferMemoryBarrier(VkPipelineStageFlags srcStageMask, 104 void addBufferMemoryBarrier(VkPipelineStageFlags srcStageMask,
108 VkPipelineStageFlags dstStageMask, 105 VkPipelineStageFlags dstStageMask,
109 bool byRegion, 106 bool byRegion,
110 VkBufferMemoryBarrier* barrier) const; 107 VkBufferMemoryBarrier* barrier) const;
111 void addImageMemoryBarrier(VkPipelineStageFlags srcStageMask, 108 void addImageMemoryBarrier(VkPipelineStageFlags srcStageMask,
112 VkPipelineStageFlags dstStageMask, 109 VkPipelineStageFlags dstStageMask,
113 bool byRegion, 110 bool byRegion,
114 VkImageMemoryBarrier* barrier) const; 111 VkImageMemoryBarrier* barrier) const;
115 112
116 shaderc_compiler_t shadercCompiler() const { 113 shaderc_compiler_t shadercCompiler() const {
117 return fCompiler; 114 return fCompiler;
118 } 115 }
119 116
120 void submitSecondaryCommandBuffer(const GrVkSecondaryCommandBuffer*); 117 void submitSecondaryCommandBuffer(const GrVkSecondaryCommandBuffer*,
118 const GrVkRenderPass*,
119 const VkClearValue*,
120 GrVkRenderTarget*,
121 const SkIRect& bounds);
121 122
122 void finishDrawTarget() override; 123 void finishDrawTarget() override;
123 124
124 void generateMipmap(GrVkTexture* tex) const; 125 void generateMipmap(GrVkTexture* tex) const;
125 126
126 // Heaps 127 // Heaps
127 enum Heap { 128 enum Heap {
128 kLinearImage_Heap = 0, 129 kLinearImage_Heap = 0,
129 // We separate out small (i.e., <= 16K) images to reduce fragmentation 130 // We separate out small (i.e., <= 16K) images to reduce fragmentation
130 // in the main heap. 131 // in the main heap.
(...skipping 27 matching lines...) Expand all
158 159
159 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership ) override; 160 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership ) override;
160 161
161 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, 162 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&,
162 GrWrapOwnership) override; 163 GrWrapOwnership) override;
163 GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTextureDes c&) override { return NULL; } 164 GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTextureDes c&) override { return NULL; }
164 165
165 GrBuffer* onCreateBuffer(size_t size, GrBufferType type, GrAccessPattern, 166 GrBuffer* onCreateBuffer(size_t size, GrBufferType type, GrAccessPattern,
166 const void* data) override; 167 const void* data) override;
167 168
168 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override;
169
170 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli p) override;
171
172 void onDraw(const GrPipeline&,
173 const GrPrimitiveProcessor&,
174 const GrMesh*,
175 int meshCount) override;
176
177 bool onReadPixels(GrSurface* surface, 169 bool onReadPixels(GrSurface* surface,
178 int left, int top, int width, int height, 170 int left, int top, int width, int height,
179 GrPixelConfig, 171 GrPixelConfig,
180 void* buffer, 172 void* buffer,
181 size_t rowBytes) override; 173 size_t rowBytes) override;
182 174
183 bool onWritePixels(GrSurface* surface, 175 bool onWritePixels(GrSurface* surface,
184 int left, int top, int width, int height, 176 int left, int top, int width, int height,
185 GrPixelConfig config, const SkTArray<GrMipLevel>&) overri de; 177 GrPixelConfig config, const SkTArray<GrMipLevel>&) overri de;
186 178
187 bool onTransferPixels(GrSurface*, 179 bool onTransferPixels(GrSurface*,
188 int left, int top, int width, int height, 180 int left, int top, int width, int height,
189 GrPixelConfig config, GrBuffer* transferBuffer, 181 GrPixelConfig config, GrBuffer* transferBuffer,
190 size_t offset, size_t rowBytes) override { return fals e; } 182 size_t offset, size_t rowBytes) override { return fals e; }
191 183
192 void onResolveRenderTarget(GrRenderTarget* target) override {} 184 void onResolveRenderTarget(GrRenderTarget* target) override {}
193 185
194 sk_sp<GrVkPipelineState> prepareDrawState(const GrPipeline&,
195 const GrPrimitiveProcessor&,
196 GrPrimitiveType,
197 const GrVkRenderPass&);
198
199 // Bind vertex and index buffers
200 void bindGeometry(const GrPrimitiveProcessor&, const GrNonInstancedMesh&);
201
202 // Ends and submits the current command buffer to the queue and then creates a new command 186 // Ends and submits the current command buffer to the queue and then creates a new command
203 // buffer and begins it. If sync is set to kForce_SyncQueue, the function wi ll wait for all 187 // buffer and begins it. If sync is set to kForce_SyncQueue, the function wi ll wait for all
204 // work in the queue to finish before returning. 188 // work in the queue to finish before returning.
205 void submitCommandBuffer(SyncQueue sync); 189 void submitCommandBuffer(SyncQueue sync);
206 190
207 void copySurfaceAsCopyImage(GrSurface* dst, 191 void copySurfaceAsCopyImage(GrSurface* dst,
208 GrSurface* src, 192 GrSurface* src,
209 GrVkImage* dstImage, 193 GrVkImage* dstImage,
210 GrVkImage* srcImage, 194 GrVkImage* srcImage,
211 const SkIRect& srcRect, 195 const SkIRect& srcRect,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 241
258 // Shaderc compiler used for compiling glsl in spirv. We only want to create the compiler once 242 // Shaderc compiler used for compiling glsl in spirv. We only want to create the compiler once
259 // since there is significant overhead to the first compile of any compiler. 243 // since there is significant overhead to the first compile of any compiler.
260 shaderc_compiler_t fCompiler; 244 shaderc_compiler_t fCompiler;
261 245
262 246
263 typedef GrGpu INHERITED; 247 typedef GrGpu INHERITED;
264 }; 248 };
265 249
266 #endif 250 #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