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

Side by Side Diff: src/gpu/vk/GrVkResourceProvider.cpp

Issue 2019723002: Subclass GrVkCommandBuffer into Primary and Secondary CommandBuffers. (Closed) Base URL: https://skia.googlesource.com/skia.git@renderPass2
Patch Set: Add executeCommands impl 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/GrVkResourceProvider.h ('k') | no next file » | 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 2016 Google Inc. 2 * Copyright 2016 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 #include "GrVkResourceProvider.h" 8 #include "GrVkResourceProvider.h"
9 9
10 #include "GrTextureParams.h" 10 #include "GrTextureParams.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 dsAllocateInfo.pNext = nullptr; 208 dsAllocateInfo.pNext = nullptr;
209 dsAllocateInfo.descriptorPool = fUniformDescPool->descPool(); 209 dsAllocateInfo.descriptorPool = fUniformDescPool->descPool();
210 dsAllocateInfo.descriptorSetCount = 1; 210 dsAllocateInfo.descriptorSetCount = 1;
211 dsAllocateInfo.pSetLayouts = &fUniformDescLayout; 211 dsAllocateInfo.pSetLayouts = &fUniformDescLayout;
212 GR_VK_CALL_ERRCHECK(fGpu->vkInterface(), AllocateDescriptorSets(fGpu->device (), 212 GR_VK_CALL_ERRCHECK(fGpu->vkInterface(), AllocateDescriptorSets(fGpu->device (),
213 &dsAllocateI nfo, 213 &dsAllocateI nfo,
214 ds)); 214 ds));
215 *outPool = fUniformDescPool; 215 *outPool = fUniformDescPool;
216 } 216 }
217 217
218 GrVkCommandBuffer* GrVkResourceProvider::createCommandBuffer() { 218 GrVkPrimaryCommandBuffer* GrVkResourceProvider::createPrimaryCommandBuffer() {
219 GrVkCommandBuffer* cmdBuffer = GrVkCommandBuffer::Create(fGpu, fGpu->cmdPool ()); 219 GrVkPrimaryCommandBuffer* cmdBuffer = GrVkPrimaryCommandBuffer::Create(fGpu, fGpu->cmdPool());
220 fActiveCommandBuffers.push_back(cmdBuffer); 220 fActiveCommandBuffers.push_back(cmdBuffer);
221 cmdBuffer->ref(); 221 cmdBuffer->ref();
222 return cmdBuffer; 222 return cmdBuffer;
223 } 223 }
224 224
225 void GrVkResourceProvider::checkCommandBuffers() { 225 void GrVkResourceProvider::checkCommandBuffers() {
226 for (int i = fActiveCommandBuffers.count()-1; i >= 0; --i) { 226 for (int i = fActiveCommandBuffers.count()-1; i >= 0; --i) {
227 if (fActiveCommandBuffers[i]->finished(fGpu)) { 227 if (fActiveCommandBuffers[i]->finished(fGpu)) {
228 fActiveCommandBuffers[i]->unref(fGpu); 228 fActiveCommandBuffers[i]->unref(fGpu);
229 fActiveCommandBuffers.removeShuffle(i); 229 fActiveCommandBuffers.removeShuffle(i);
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 } 349 }
350 350
351 void GrVkResourceProvider::CompatibleRenderPassSet::abandonResources() { 351 void GrVkResourceProvider::CompatibleRenderPassSet::abandonResources() {
352 for (int i = 0; i < fRenderPasses.count(); ++i) { 352 for (int i = 0; i < fRenderPasses.count(); ++i) {
353 if (fRenderPasses[i]) { 353 if (fRenderPasses[i]) {
354 fRenderPasses[i]->unrefAndAbandon(); 354 fRenderPasses[i]->unrefAndAbandon();
355 fRenderPasses[i] = nullptr; 355 fRenderPasses[i] = nullptr;
356 } 356 }
357 } 357 }
358 } 358 }
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkResourceProvider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698