| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 } | 72 } |
| 73 | 73 |
| 74 GrVkRenderPass* renderPass = new GrVkRenderPass(); | 74 GrVkRenderPass* renderPass = new GrVkRenderPass(); |
| 75 renderPass->initSimple(fGpu, target); | 75 renderPass->initSimple(fGpu, target); |
| 76 fSimpleRenderPasses.push_back(renderPass); | 76 fSimpleRenderPasses.push_back(renderPass); |
| 77 renderPass->ref(); | 77 renderPass->ref(); |
| 78 return renderPass; | 78 return renderPass; |
| 79 } | 79 } |
| 80 | 80 |
| 81 GrVkDescriptorPool* GrVkResourceProvider::findOrCreateCompatibleDescriptorPool( | 81 GrVkDescriptorPool* GrVkResourceProvider::findOrCreateCompatibleDescriptorPool( |
| 82 const GrVkDescriptorPool::DescriptorTypeC
ounts& typeCounts) { | 82 VkDescriptorType typ
e, uint32_t count) { |
| 83 return new GrVkDescriptorPool(fGpu, typeCounts); | 83 return new GrVkDescriptorPool(fGpu, type, count); |
| 84 } | 84 } |
| 85 | 85 |
| 86 GrVkSampler* GrVkResourceProvider::findOrCreateCompatibleSampler(const GrTexture
Params& params) { | 86 GrVkSampler* GrVkResourceProvider::findOrCreateCompatibleSampler(const GrTexture
Params& params) { |
| 87 GrVkSampler* sampler = fSamplers.find(GrVkSampler::GenerateKey(params)); | 87 GrVkSampler* sampler = fSamplers.find(GrVkSampler::GenerateKey(params)); |
| 88 if (!sampler) { | 88 if (!sampler) { |
| 89 sampler = GrVkSampler::Create(fGpu, params); | 89 sampler = GrVkSampler::Create(fGpu, params); |
| 90 fSamplers.add(sampler); | 90 fSamplers.add(sampler); |
| 91 } | 91 } |
| 92 SkASSERT(sampler); | 92 SkASSERT(sampler); |
| 93 sampler->ref(); | 93 sampler->ref(); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 for (; !iter.done(); ++iter) { | 158 for (; !iter.done(); ++iter) { |
| 159 (*iter).unrefAndAbandon(); | 159 (*iter).unrefAndAbandon(); |
| 160 } | 160 } |
| 161 fSamplers.reset(); | 161 fSamplers.reset(); |
| 162 | 162 |
| 163 #ifdef SK_TRACE_VK_RESOURCES | 163 #ifdef SK_TRACE_VK_RESOURCES |
| 164 SkASSERT(0 == GrVkResource::fTrace.count()); | 164 SkASSERT(0 == GrVkResource::fTrace.count()); |
| 165 #endif | 165 #endif |
| 166 fPipelineCache = VK_NULL_HANDLE; | 166 fPipelineCache = VK_NULL_HANDLE; |
| 167 } | 167 } |
| OLD | NEW |