Index: src/gpu/vk/GrVkResourceProvider.cpp |
diff --git a/src/gpu/vk/GrVkResourceProvider.cpp b/src/gpu/vk/GrVkResourceProvider.cpp |
index 4f6c7927c752b58ebd4c6d89de36d76230cc3e3e..81dcf586b76beff09f9837cc4c8b8438d9b5399a 100644 |
--- a/src/gpu/vk/GrVkResourceProvider.cpp |
+++ b/src/gpu/vk/GrVkResourceProvider.cpp |
@@ -196,8 +196,9 @@ void GrVkResourceProvider::getUniformDescriptorSet(VkDescriptorSet* ds, |
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; |
} |