Commit 75690ce7 by Alexis Hetu Committed by Alexis Hétu

DescriptorPool error fix

DescriptorPool::computeTotalFreeSize() was adding the size of the last element to its available memory size, rather than subtracting it, which was causing the DescriptorPool to return the wrong error (VK_ERROR_FRAGMENTED_POOL instead of VK_ERROR_OUT_OF_POOL_MEMORY). Bug: b/167617619 Change-Id: Ie60c2fe521b0d233b32504b446af1715361f5c21 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/47549Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 6c80505c
...@@ -147,7 +147,7 @@ VkResult DescriptorPool::allocateSets(size_t *sizes, uint32_t numAllocs, VkDescr ...@@ -147,7 +147,7 @@ VkResult DescriptorPool::allocateSets(size_t *sizes, uint32_t numAllocs, VkDescr
} }
} }
// Atttempt to allocate each descriptor set separately // Attempt to allocate each descriptor set separately
for(uint32_t i = 0; i < numAllocs; i++) for(uint32_t i = 0; i < numAllocs; i++)
{ {
uint8_t *memory = findAvailableMemory(sizes[i]); uint8_t *memory = findAvailableMemory(sizes[i]);
...@@ -205,7 +205,7 @@ size_t DescriptorPool::computeTotalFreeSize() const ...@@ -205,7 +205,7 @@ size_t DescriptorPool::computeTotalFreeSize() const
// Compute space at the end of the pool // Compute space at the end of the pool
const auto itLast = nodes.rbegin(); const auto itLast = nodes.rbegin();
totalFreeSize += poolSize - (itLast->set - pool) + itLast->size; totalFreeSize += poolSize - ((itLast->set - pool) + itLast->size);
// Compute space at the beginning of the pool // Compute space at the beginning of the pool
const auto itBegin = nodes.begin(); const auto itBegin = nodes.begin();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment