| 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 commandBuffer.addResource(fTextures[i]); | 402 commandBuffer.addResource(fTextures[i]); |
| 403 } | 403 } |
| 404 } | 404 } |
| 405 | 405 |
| 406 //////////////////////////////////////////////////////////////////////////////// | 406 //////////////////////////////////////////////////////////////////////////////// |
| 407 | 407 |
| 408 void GrVkPipelineState::DescriptorPoolManager::getNewPool(GrVkGpu* gpu) { | 408 void GrVkPipelineState::DescriptorPoolManager::getNewPool(GrVkGpu* gpu) { |
| 409 if (fPool) { | 409 if (fPool) { |
| 410 fPool->unref(gpu); | 410 fPool->unref(gpu); |
| 411 SkASSERT(fMaxDescriptorSets < (SK_MaxU32 >> 1)); | 411 SkASSERT(fMaxDescriptorSets < (SK_MaxU32 >> 1)); |
| 412 fMaxDescriptorSets = fMaxDescriptorSets << 1; | 412 if (fMaxDescriptorSets < kMaxDescSetLimit >> 1) { |
| 413 fMaxDescriptorSets = fMaxDescriptorSets << 1; |
| 414 } else { |
| 415 fMaxDescriptorSets = kMaxDescSetLimit; |
| 416 } |
| 413 | 417 |
| 414 } | 418 } |
| 415 if (fMaxDescriptorSets) { | 419 if (fMaxDescriptorSets) { |
| 416 fPool = gpu->resourceProvider().findOrCreateCompatibleDescriptorPool(fDe
scType, | 420 fPool = gpu->resourceProvider().findOrCreateCompatibleDescriptorPool(fDe
scType, |
| 417 fMa
xDescriptorSets); | 421 fMa
xDescriptorSets); |
| 418 } | 422 } |
| 419 SkASSERT(fPool || !fMaxDescriptorSets); | 423 SkASSERT(fPool || !fMaxDescriptorSets); |
| 420 } | 424 } |
| 421 | 425 |
| 422 void GrVkPipelineState::DescriptorPoolManager::getNewDescriptorSet(GrVkGpu* gpu,
VkDescriptorSet* ds) { | 426 void GrVkPipelineState::DescriptorPoolManager::getNewDescriptorSet(GrVkGpu* gpu,
VkDescriptorSet* ds) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 | 501 |
| 498 b.add32(get_blend_info_key(pipeline)); | 502 b.add32(get_blend_info_key(pipeline)); |
| 499 | 503 |
| 500 b.add32(primitiveType); | 504 b.add32(primitiveType); |
| 501 | 505 |
| 502 // Set key length | 506 // Set key length |
| 503 int keyLength = key->count(); | 507 int keyLength = key->count(); |
| 504 SkASSERT(0 == (keyLength % 4)); | 508 SkASSERT(0 == (keyLength % 4)); |
| 505 *reinterpret_cast<uint32_t*>(key->begin()) = SkToU32(keyLength); | 509 *reinterpret_cast<uint32_t*>(key->begin()) = SkToU32(keyLength); |
| 506 } | 510 } |
| OLD | NEW |