| 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 "GrVkPipelineState.h" | 8 #include "GrVkPipelineState.h" |
| 9 | 9 |
| 10 #include "GrPipeline.h" | 10 #include "GrPipeline.h" |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 for (int i = 0; i < fTextures.count(); ++i) { | 391 for (int i = 0; i < fTextures.count(); ++i) { |
| 392 commandBuffer.addResource(fTextures[i]); | 392 commandBuffer.addResource(fTextures[i]); |
| 393 } | 393 } |
| 394 } | 394 } |
| 395 | 395 |
| 396 //////////////////////////////////////////////////////////////////////////////// | 396 //////////////////////////////////////////////////////////////////////////////// |
| 397 | 397 |
| 398 void GrVkPipelineState::DescriptorPoolManager::getNewPool(GrVkGpu* gpu) { | 398 void GrVkPipelineState::DescriptorPoolManager::getNewPool(GrVkGpu* gpu) { |
| 399 if (fPool) { | 399 if (fPool) { |
| 400 fPool->unref(gpu); | 400 fPool->unref(gpu); |
| 401 if (fMaxDescriptors < kMaxDescLimit >> 1) { | 401 uint32_t newPoolSize = fMaxDescriptors + ((fMaxDescriptors + 1) >> 1); |
| 402 fMaxDescriptors = fMaxDescriptors << 1; | 402 if (newPoolSize < kMaxDescLimit) { |
| 403 fMaxDescriptors = newPoolSize; |
| 403 } else { | 404 } else { |
| 404 fMaxDescriptors = kMaxDescLimit; | 405 fMaxDescriptors = kMaxDescLimit; |
| 405 } | 406 } |
| 406 | 407 |
| 407 } | 408 } |
| 408 if (fMaxDescriptors) { | 409 if (fMaxDescriptors) { |
| 409 fPool = gpu->resourceProvider().findOrCreateCompatibleDescriptorPool(fDe
scType, | 410 fPool = gpu->resourceProvider().findOrCreateCompatibleDescriptorPool(fDe
scType, |
| 410 fMa
xDescriptors); | 411 fMa
xDescriptors); |
| 411 } | 412 } |
| 412 SkASSERT(fPool || !fMaxDescriptors); | 413 SkASSERT(fPool || !fMaxDescriptors); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 | 492 |
| 492 b.add32(get_blend_info_key(pipeline)); | 493 b.add32(get_blend_info_key(pipeline)); |
| 493 | 494 |
| 494 b.add32(primitiveType); | 495 b.add32(primitiveType); |
| 495 | 496 |
| 496 // Set key length | 497 // Set key length |
| 497 int keyLength = key->count(); | 498 int keyLength = key->count(); |
| 498 SkASSERT(0 == (keyLength % 4)); | 499 SkASSERT(0 == (keyLength % 4)); |
| 499 *reinterpret_cast<uint32_t*>(key->begin()) = SkToU32(keyLength); | 500 *reinterpret_cast<uint32_t*>(key->begin()) = SkToU32(keyLength); |
| 500 } | 501 } |
| OLD | NEW |