mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 23:26:24 +00:00
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:
committed by
Commit Bot service account
parent
56b12422da
commit
ff8b3f4397
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user