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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 GrVkSampler* sampler = fSamplers.find(GrVkSampler::GenerateKey(params)); | 89 GrVkSampler* sampler = fSamplers.find(GrVkSampler::GenerateKey(params)); |
90 if (!sampler) { | 90 if (!sampler) { |
91 sampler = GrVkSampler::Create(fGpu, params); | 91 sampler = GrVkSampler::Create(fGpu, params); |
92 fSamplers.add(sampler); | 92 fSamplers.add(sampler); |
93 } | 93 } |
94 SkASSERT(sampler); | 94 SkASSERT(sampler); |
95 sampler->ref(); | 95 sampler->ref(); |
96 return sampler; | 96 return sampler; |
97 } | 97 } |
98 | 98 |
99 GrVkPipelineState* GrVkResourceProvider::findOrCreateCompatiblePipelineState( | 99 sk_sp<GrVkPipelineState> GrVkResourceProvider::findOrCreateCompatiblePipelineSta
te( |
100 const GrPipelin
e& pipeline, | 100 const GrPipelin
e& pipeline, |
101 const GrPrimiti
veProcessor& proc, | 101 const GrPrimiti
veProcessor& proc, |
102 GrPrimitiveType
primitiveType, | 102 GrPrimitiveType
primitiveType, |
103 const GrVkRende
rPass& renderPass) { | 103 const GrVkRende
rPass& renderPass) { |
104 return fPipelineStateCache->refPipelineState(pipeline, proc, primitiveType,
renderPass); | 104 return fPipelineStateCache->refPipelineState(pipeline, proc, primitiveType,
renderPass); |
105 } | 105 } |
106 | 106 |
107 GrVkCommandBuffer* GrVkResourceProvider::createCommandBuffer() { | 107 GrVkCommandBuffer* GrVkResourceProvider::createCommandBuffer() { |
108 GrVkCommandBuffer* cmdBuffer = GrVkCommandBuffer::Create(fGpu, fGpu->cmdPool
()); | 108 GrVkCommandBuffer* cmdBuffer = GrVkCommandBuffer::Create(fGpu, fGpu->cmdPool
()); |
109 fActiveCommandBuffers.push_back(cmdBuffer); | 109 fActiveCommandBuffers.push_back(cmdBuffer); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 } | 172 } |
173 fSamplers.reset(); | 173 fSamplers.reset(); |
174 | 174 |
175 fPipelineStateCache->abandon(); | 175 fPipelineStateCache->abandon(); |
176 | 176 |
177 #ifdef SK_TRACE_VK_RESOURCES | 177 #ifdef SK_TRACE_VK_RESOURCES |
178 SkASSERT(0 == GrVkResource::fTrace.count()); | 178 SkASSERT(0 == GrVkResource::fTrace.count()); |
179 #endif | 179 #endif |
180 fPipelineCache = VK_NULL_HANDLE; | 180 fPipelineCache = VK_NULL_HANDLE; |
181 } | 181 } |
OLD | NEW |