mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 10:49:14 +00:00
Move kInvalidOffset to RingBufferAllocator namespace.
BUG=dawn:27 Change-Id: I1c580d8e41c4f9bb10b638297b4c3a3fa61a0d93 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11680 Commit-Queue: Austin Eng <enga@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
f622a44750
commit
52bd6b7da6
@@ -44,14 +44,14 @@ namespace dawn_native {
|
||||
}
|
||||
}
|
||||
|
||||
size_t startOffset = kInvalidOffset;
|
||||
size_t startOffset = RingBufferAllocator::kInvalidOffset;
|
||||
if (targetRingBuffer != nullptr) {
|
||||
startOffset = targetRingBuffer->mAllocator.Allocate(allocationSize, serial);
|
||||
}
|
||||
|
||||
// Upon failure, append a newly created (and much larger) ring buffer to fulfill the
|
||||
// request.
|
||||
if (startOffset == kInvalidOffset) {
|
||||
if (startOffset == RingBufferAllocator::kInvalidOffset) {
|
||||
// Compute the new max size (in powers of two to preserve alignment).
|
||||
size_t newMaxSize = targetRingBuffer->mAllocator.GetSize() * 2;
|
||||
while (newMaxSize < allocationSize) {
|
||||
@@ -66,7 +66,7 @@ namespace dawn_native {
|
||||
startOffset = targetRingBuffer->mAllocator.Allocate(allocationSize, serial);
|
||||
}
|
||||
|
||||
ASSERT(startOffset != kInvalidOffset);
|
||||
ASSERT(startOffset != RingBufferAllocator::kInvalidOffset);
|
||||
|
||||
// Allocate the staging buffer backing the ringbuffer.
|
||||
// Note: the first ringbuffer will be lazily created.
|
||||
|
||||
Reference in New Issue
Block a user