summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/libANGLE/HandleAllocator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/angle/src/libANGLE/HandleAllocator.cpp')
-rw-r--r--src/3rdparty/angle/src/libANGLE/HandleAllocator.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/3rdparty/angle/src/libANGLE/HandleAllocator.cpp b/src/3rdparty/angle/src/libANGLE/HandleAllocator.cpp
index 59d3966758..4815855d5a 100644
--- a/src/3rdparty/angle/src/libANGLE/HandleAllocator.cpp
+++ b/src/3rdparty/angle/src/libANGLE/HandleAllocator.cpp
@@ -20,13 +20,13 @@ struct HandleAllocator::HandleRangeComparator
{
bool operator()(const HandleRange &range, GLuint handle) const
{
- return (handle < range.begin);
+ return (range.end < handle);
}
};
HandleAllocator::HandleAllocator() : mBaseValue(1), mNextValue(1)
{
- mUnallocatedList.push_back(HandleRange(1, std::numeric_limits<GLuint>::max() - 1));
+ mUnallocatedList.push_back(HandleRange(1, std::numeric_limits<GLuint>::max()));
}
HandleAllocator::HandleAllocator(GLuint maximumHandleValue) : mBaseValue(1), mNextValue(1)
@@ -120,14 +120,15 @@ void HandleAllocator::reserve(GLuint handle)
// need to split the range
auto placementIt = mUnallocatedList.erase(boundIt);
- if (begin != handle)
+ if (handle + 1 != end)
{
- placementIt = mUnallocatedList.insert(placementIt, HandleRange(begin, handle));
+ placementIt = mUnallocatedList.insert(placementIt, HandleRange(handle + 1, end));
}
- if (handle + 1 != end)
+ if (begin != handle)
{
- mUnallocatedList.insert(placementIt, HandleRange(handle + 1, end));
+ ASSERT(begin < handle);
+ mUnallocatedList.insert(placementIt, HandleRange(begin, handle));
}
}
-}
+} // namespace gl