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 "GrVkResourceProvider.h" | 8 #include "GrVkResourceProvider.h" |
9 | 9 |
10 #include "GrTextureParams.h" | 10 #include "GrTextureParams.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 void GrVkResourceProvider::recycleSecondaryCommandBuffer(GrVkSecondaryCommandBuf
fer* cb) { | 263 void GrVkResourceProvider::recycleSecondaryCommandBuffer(GrVkSecondaryCommandBuf
fer* cb) { |
264 cb->reset(fGpu); | 264 cb->reset(fGpu); |
265 fAvailableSecondaryCommandBuffers.push_back(cb); | 265 fAvailableSecondaryCommandBuffers.push_back(cb); |
266 } | 266 } |
267 | 267 |
268 void GrVkResourceProvider::destroyResources() { | 268 void GrVkResourceProvider::destroyResources() { |
269 // release our active command buffers | 269 // release our active command buffers |
270 for (int i = 0; i < fActiveCommandBuffers.count(); ++i) { | 270 for (int i = 0; i < fActiveCommandBuffers.count(); ++i) { |
271 SkASSERT(fActiveCommandBuffers[i]->finished(fGpu)); | 271 SkASSERT(fActiveCommandBuffers[i]->finished(fGpu)); |
272 SkASSERT(fActiveCommandBuffers[i]->unique()); | 272 SkASSERT(fActiveCommandBuffers[i]->unique()); |
| 273 fActiveCommandBuffers[i]->reset(fGpu); |
273 fActiveCommandBuffers[i]->unref(fGpu); | 274 fActiveCommandBuffers[i]->unref(fGpu); |
274 } | 275 } |
275 fActiveCommandBuffers.reset(); | 276 fActiveCommandBuffers.reset(); |
276 // release our available command buffers | 277 // release our available command buffers |
277 for (int i = 0; i < fAvailableCommandBuffers.count(); ++i) { | 278 for (int i = 0; i < fAvailableCommandBuffers.count(); ++i) { |
278 SkASSERT(fAvailableCommandBuffers[i]->finished(fGpu)); | 279 SkASSERT(fAvailableCommandBuffers[i]->finished(fGpu)); |
279 SkASSERT(fAvailableCommandBuffers[i]->unique()); | 280 SkASSERT(fAvailableCommandBuffers[i]->unique()); |
280 fAvailableCommandBuffers[i]->unref(fGpu); | 281 fAvailableCommandBuffers[i]->unref(fGpu); |
281 } | 282 } |
282 fAvailableCommandBuffers.reset(); | 283 fAvailableCommandBuffers.reset(); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 } | 426 } |
426 | 427 |
427 void GrVkResourceProvider::CompatibleRenderPassSet::abandonResources() { | 428 void GrVkResourceProvider::CompatibleRenderPassSet::abandonResources() { |
428 for (int i = 0; i < fRenderPasses.count(); ++i) { | 429 for (int i = 0; i < fRenderPasses.count(); ++i) { |
429 if (fRenderPasses[i]) { | 430 if (fRenderPasses[i]) { |
430 fRenderPasses[i]->unrefAndAbandon(); | 431 fRenderPasses[i]->unrefAndAbandon(); |
431 fRenderPasses[i] = nullptr; | 432 fRenderPasses[i] = nullptr; |
432 } | 433 } |
433 } | 434 } |
434 } | 435 } |
OLD | NEW |