Remove an unused ASSERT in CopyFromStagingBuffer
This function removes an unused assertion on mStagingBuffer in
CopyFromStagingBuffer() as function CopyFromStagingBuffer() can
only be called when we are using a staging buffer for mapped at
creation, which has been guarded by another assertion at the
beginning of this function.
Bug: dawn:828
Change-Id: I9b03b7e42013ce8167d2b45b1d4411b187ee6934
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/145200
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
diff --git a/src/dawn/native/Buffer.cpp b/src/dawn/native/Buffer.cpp
index cf5376a..6694b82 100644
--- a/src/dawn/native/Buffer.cpp
+++ b/src/dawn/native/Buffer.cpp
@@ -463,12 +463,7 @@
}
MaybeError BufferBase::CopyFromStagingBuffer() {
- ASSERT(mStagingBuffer != nullptr);
- if (mSize == 0) {
- // Staging buffer is not created if zero size.
- ASSERT(mStagingBuffer == nullptr);
- return {};
- }
+ ASSERT(mStagingBuffer != nullptr && mSize != 0);
DAWN_TRY(
GetDevice()->CopyFromStagingToBuffer(mStagingBuffer.Get(), 0, this, 0, GetAllocatedSize()));