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" |
11 #include "GrVkCommandBuffer.h" | 11 #include "GrVkCommandBuffer.h" |
12 #include "GrVkPipeline.h" | 12 #include "GrVkPipeline.h" |
13 #include "GrVkRenderTarget.h" | 13 #include "GrVkRenderTarget.h" |
14 #include "GrVkSampler.h" | 14 #include "GrVkSampler.h" |
15 #include "GrVkUtil.h" | 15 #include "GrVkUtil.h" |
16 | 16 |
17 #ifdef SK_TRACE_VK_RESOURCES | 17 #ifdef SK_TRACE_VK_RESOURCES |
18 GrVkResource::Trace GrVkResource::fTrace; | 18 GrVkResource::Trace GrVkResource::fTrace; |
19 SkRandom GrVkResource::fRandom; | 19 uint32_t GrVkResource::fKeyCounter = 0; |
20 #endif | 20 #endif |
21 | 21 |
22 GrVkResourceProvider::GrVkResourceProvider(GrVkGpu* gpu) | 22 GrVkResourceProvider::GrVkResourceProvider(GrVkGpu* gpu) |
23 : fGpu(gpu) | 23 : fGpu(gpu) |
24 , fPipelineCache(VK_NULL_HANDLE) | 24 , fPipelineCache(VK_NULL_HANDLE) |
25 , fUniformDescPool(nullptr) | 25 , fUniformDescPool(nullptr) |
26 , fCurrentUniformDescCount(0) { | 26 , fCurrentUniformDescCount(0) { |
27 fPipelineStateCache = new PipelineStateCache(gpu); | 27 fPipelineStateCache = new PipelineStateCache(gpu); |
28 } | 28 } |
29 | 29 |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 } | 406 } |
407 | 407 |
408 void GrVkResourceProvider::CompatibleRenderPassSet::abandonResources() { | 408 void GrVkResourceProvider::CompatibleRenderPassSet::abandonResources() { |
409 for (int i = 0; i < fRenderPasses.count(); ++i) { | 409 for (int i = 0; i < fRenderPasses.count(); ++i) { |
410 if (fRenderPasses[i]) { | 410 if (fRenderPasses[i]) { |
411 fRenderPasses[i]->unrefAndAbandon(); | 411 fRenderPasses[i]->unrefAndAbandon(); |
412 fRenderPasses[i] = nullptr; | 412 fRenderPasses[i] = nullptr; |
413 } | 413 } |
414 } | 414 } |
415 } | 415 } |
OLD | NEW |