BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=
2121243002
Review-Url: https://codereview.chromium.org/
2121243002
void GrVkPipelineState::DescriptorPoolManager::getNewPool(GrVkGpu* gpu) {
if (fPool) {
fPool->unref(gpu);
- if (fMaxDescriptors < kMaxDescLimit >> 1) {
- fMaxDescriptors = fMaxDescriptors << 1;
+ uint32_t newPoolSize = fMaxDescriptors + ((fMaxDescriptors + 1) >> 1);
+ if (newPoolSize < kMaxDescLimit) {
+ fMaxDescriptors = newPoolSize;
} else {
fMaxDescriptors = kMaxDescLimit;
}
fCurrentUniformDescCount += kNumUniformDescPerSet;
if (fCurrentUniformDescCount > fCurrMaxUniDescriptors) {
fUniformDescPool->unref(fGpu);
- if (fCurrMaxUniDescriptors < kMaxUniformDescriptors >> 1) {
- fCurrMaxUniDescriptors = fCurrMaxUniDescriptors << 1;
+ uint32_t newPoolSize = fCurrMaxUniDescriptors + ((fCurrMaxUniDescriptors + 1) >> 1);
+ if (newPoolSize < kMaxUniformDescriptors) {
+ fCurrMaxUniDescriptors = newPoolSize;
} else {
fCurrMaxUniDescriptors = kMaxUniformDescriptors;
}