OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |