Commit fe60973b by Tobin Ehlis Committed by Commit Bot

Vulkan: Allow commands to completely fill allocation

If the remaining allocation size for commands in the SecondaryCommandBuffer class is equal to the command allocation size and the follow-on header, then we can fill the allocation. Previously we were conservative and if the size needed exactly equals the size remaining, we would allocate a new block. Bug: b/154030403 Change-Id: Ie31f0f5d33782d12adbaea9e3b02598a004d7643 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2158817Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCharlie Lao <cclao@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
parent 9dc322d7
...@@ -699,7 +699,7 @@ class SecondaryCommandBuffer final : angle::NonCopyable ...@@ -699,7 +699,7 @@ class SecondaryCommandBuffer final : angle::NonCopyable
constexpr size_t fixedAllocationSize = sizeof(StructType) + sizeof(CommandHeader); constexpr size_t fixedAllocationSize = sizeof(StructType) + sizeof(CommandHeader);
const size_t allocationSize = fixedAllocationSize + variableSize; const size_t allocationSize = fixedAllocationSize + variableSize;
// Make sure we have enough room to mark follow-on header "Invalid" // Make sure we have enough room to mark follow-on header "Invalid"
if (mCurrentBytesRemaining <= (allocationSize + sizeof(CommandHeader))) if (mCurrentBytesRemaining < (allocationSize + sizeof(CommandHeader)))
{ {
allocateNewBlock(); allocateNewBlock();
} }
...@@ -713,7 +713,7 @@ class SecondaryCommandBuffer final : angle::NonCopyable ...@@ -713,7 +713,7 @@ class SecondaryCommandBuffer final : angle::NonCopyable
{ {
constexpr size_t allocationSize = sizeof(StructType) + sizeof(CommandHeader); constexpr size_t allocationSize = sizeof(StructType) + sizeof(CommandHeader);
// Make sure we have enough room to mark follow-on header "Invalid" // Make sure we have enough room to mark follow-on header "Invalid"
if (mCurrentBytesRemaining <= (allocationSize + sizeof(CommandHeader))) if (mCurrentBytesRemaining < (allocationSize + sizeof(CommandHeader)))
{ {
allocateNewBlock(); allocateNewBlock();
} }
......
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