Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: src/gpu/vk/GrVkResourceProvider.cpp

Issue 1836863002: Change VkPipelineStateCahce to use Hash and LRU LList. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update macro name Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/vk/GrVkResourceProvider.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkResourceProvider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698