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:
Bryan Bernhart
2019-09-27 21:26:13 +00:00
committed by Commit Bot service account
parent f622a44750
commit 52bd6b7da6
3 changed files with 15 additions and 10 deletions

View File

@@ -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.