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

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

Issue 2115993002: Add resource tracking output and command buffer recycling (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 4 years, 5 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/GrVkGpu.cpp ('k') | src/gpu/vk/GrVkImage.h » ('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 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 "GrVkGpuCommandBuffer.h" 8 #include "GrVkGpuCommandBuffer.h"
9 9
10 #include "GrMesh.h" 10 #include "GrMesh.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 vkStencilOps); 77 vkStencilOps);
78 } else { 78 } else {
79 fRenderPass = fGpu->resourceProvider().findRenderPass(*target, 79 fRenderPass = fGpu->resourceProvider().findRenderPass(*target,
80 vkColorOps, 80 vkColorOps,
81 vkResolveOps, 81 vkResolveOps,
82 vkStencilOps); 82 vkStencilOps);
83 } 83 }
84 84
85 GrColorToRGBAFloat(colorInfo.fClearColor, fColorClearValue.color.float32); 85 GrColorToRGBAFloat(colorInfo.fClearColor, fColorClearValue.color.float32);
86 86
87 fCommandBuffer = GrVkSecondaryCommandBuffer::Create(gpu, gpu->cmdPool(), fRe nderPass); 87 fCommandBuffer = gpu->resourceProvider().findOrCreateSecondaryCommandBuffer( );
88 fCommandBuffer->begin(gpu, target->framebuffer()); 88 fCommandBuffer->begin(gpu, target->framebuffer(), fRenderPass);
89 } 89 }
90 90
91 GrVkGpuCommandBuffer::~GrVkGpuCommandBuffer() { 91 GrVkGpuCommandBuffer::~GrVkGpuCommandBuffer() {
92 fCommandBuffer->unref(fGpu); 92 fCommandBuffer->unref(fGpu);
93 fRenderPass->unref(fGpu); 93 fRenderPass->unref(fGpu);
94 } 94 }
95 95
96 GrGpu* GrVkGpuCommandBuffer::gpu() { return fGpu; } 96 GrGpu* GrVkGpuCommandBuffer::gpu() { return fGpu; }
97 97
98 void GrVkGpuCommandBuffer::end() { 98 void GrVkGpuCommandBuffer::end() {
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 fGpu->stats()->incNumDraws(); 428 fGpu->stats()->incNumDraws();
429 } while ((nonIdxMesh = iter.next())); 429 } while ((nonIdxMesh = iter.next()));
430 } 430 }
431 431
432 // Technically we don't have to call this here (since there is a safety chec k in 432 // Technically we don't have to call this here (since there is a safety chec k in
433 // pipelineState:setData but this will allow for quicker freeing of resource s if the 433 // pipelineState:setData but this will allow for quicker freeing of resource s if the
434 // pipelineState sits in a cache for a while. 434 // pipelineState sits in a cache for a while.
435 pipelineState->freeTempResources(fGpu); 435 pipelineState->freeTempResources(fGpu);
436 } 436 }
437 437
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkGpu.cpp ('k') | src/gpu/vk/GrVkImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698