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

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

Issue 2121243002: Grow descriptor pools by 1.5 (Closed) Base URL: https://skia.googlesource.com/skia.git@filters
Patch Set: Created 4 years, 5 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/GrVkPipelineState.cpp ('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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 GrPrimitiveType primitiveType, 189 GrPrimitiveType primitiveType,
190 const GrVkRende rPass& renderPass) { 190 const GrVkRende rPass& renderPass) {
191 return fPipelineStateCache->refPipelineState(pipeline, proc, primitiveType, renderPass); 191 return fPipelineStateCache->refPipelineState(pipeline, proc, primitiveType, renderPass);
192 } 192 }
193 193
194 void GrVkResourceProvider::getUniformDescriptorSet(VkDescriptorSet* ds, 194 void GrVkResourceProvider::getUniformDescriptorSet(VkDescriptorSet* ds,
195 const GrVkDescriptorPool** ou tPool) { 195 const GrVkDescriptorPool** ou tPool) {
196 fCurrentUniformDescCount += kNumUniformDescPerSet; 196 fCurrentUniformDescCount += kNumUniformDescPerSet;
197 if (fCurrentUniformDescCount > fCurrMaxUniDescriptors) { 197 if (fCurrentUniformDescCount > fCurrMaxUniDescriptors) {
198 fUniformDescPool->unref(fGpu); 198 fUniformDescPool->unref(fGpu);
199 if (fCurrMaxUniDescriptors < kMaxUniformDescriptors >> 1) { 199 uint32_t newPoolSize = fCurrMaxUniDescriptors + ((fCurrMaxUniDescriptors + 1) >> 1);
200 fCurrMaxUniDescriptors = fCurrMaxUniDescriptors << 1; 200 if (newPoolSize < kMaxUniformDescriptors) {
201 fCurrMaxUniDescriptors = newPoolSize;
201 } else { 202 } else {
202 fCurrMaxUniDescriptors = kMaxUniformDescriptors; 203 fCurrMaxUniDescriptors = kMaxUniformDescriptors;
203 } 204 }
204 fUniformDescPool = 205 fUniformDescPool =
205 this->findOrCreateCompatibleDescriptorPool(VK_DESCRIPTOR_TYPE_UNIFOR M_BUFFER, 206 this->findOrCreateCompatibleDescriptorPool(VK_DESCRIPTOR_TYPE_UNIFOR M_BUFFER,
206 fCurrMaxUniDescriptors); 207 fCurrMaxUniDescriptors);
207 fCurrentUniformDescCount = kNumUniformDescPerSet; 208 fCurrentUniformDescCount = kNumUniformDescPerSet;
208 } 209 }
209 SkASSERT(fUniformDescPool); 210 SkASSERT(fUniformDescPool);
210 211
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 } 357 }
357 358
358 void GrVkResourceProvider::CompatibleRenderPassSet::abandonResources() { 359 void GrVkResourceProvider::CompatibleRenderPassSet::abandonResources() {
359 for (int i = 0; i < fRenderPasses.count(); ++i) { 360 for (int i = 0; i < fRenderPasses.count(); ++i) {
360 if (fRenderPasses[i]) { 361 if (fRenderPasses[i]) {
361 fRenderPasses[i]->unrefAndAbandon(); 362 fRenderPasses[i]->unrefAndAbandon();
362 fRenderPasses[i] = nullptr; 363 fRenderPasses[i] = nullptr;
363 } 364 }
364 } 365 }
365 } 366 }
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkPipelineState.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698