Inline CommandAllocator/Iterator

Inlining these hot functions decreases CPU time in perf tests for
DrawCallPerf.Run/Vulkan by roughly 12% (55 to 47ns) and increases
binary size by about 0.16% (~4kB).

Bug: dawn:304
Change-Id: I84e5d011defe88d6f1492dcb54e421c3d1bf099f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14000
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Austin Eng
2019-12-10 01:10:27 +00:00
committed by Commit Bot service account
parent 56b12422da
commit ff8b3f4397
5 changed files with 138 additions and 114 deletions

View File

@@ -85,13 +85,6 @@ bool IsPtrAligned(const void* ptr, size_t alignment) {
return (reinterpret_cast<size_t>(ptr) & (alignment - 1)) == 0;
}
void* AlignVoidPtr(void* ptr, size_t alignment) {
ASSERT(IsPowerOfTwo(alignment));
ASSERT(alignment != 0);
return reinterpret_cast<void*>((reinterpret_cast<size_t>(ptr) + (alignment - 1)) &
~(alignment - 1));
}
bool IsAligned(uint32_t value, size_t alignment) {
ASSERT(alignment <= UINT32_MAX);
ASSERT(IsPowerOfTwo(alignment));