mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-17 00:47:13 +00:00
Add Create/ReleaseStagingBuffer to DynamicUploader
StagingBuffers need to be created and explicitly released outside of the RingBuffer for CreateBufferMapped since the staging buffer must live until the Buffer is Unmapped or Destroyed. This patch adds methods to the DynamicUploaded for creating and tracking the release of StagingBuffers. This patch also fixes SerialQueue for non-copy-constructible types. Bug: dawn:7 Change-Id: I582c4d9cf452f808a8a7ab4164ff833087619a18 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7720 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
b632bc58ed
commit
233ce73c50
@@ -54,9 +54,9 @@ void SerialQueue<T>::Enqueue(const T& value, Serial serial) {
|
||||
DAWN_ASSERT(this->Empty() || this->mStorage.back().first <= serial);
|
||||
|
||||
if (this->Empty() || this->mStorage.back().first < serial) {
|
||||
this->mStorage.emplace_back(SerialPair(serial, {}));
|
||||
this->mStorage.emplace_back(serial, std::vector<T>{});
|
||||
}
|
||||
this->mStorage.back().second.emplace_back(value);
|
||||
this->mStorage.back().second.push_back(value);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@@ -64,23 +64,23 @@ void SerialQueue<T>::Enqueue(T&& value, Serial serial) {
|
||||
DAWN_ASSERT(this->Empty() || this->mStorage.back().first <= serial);
|
||||
|
||||
if (this->Empty() || this->mStorage.back().first < serial) {
|
||||
this->mStorage.emplace_back(SerialPair(serial, {}));
|
||||
this->mStorage.emplace_back(serial, std::vector<T>{});
|
||||
}
|
||||
this->mStorage.back().second.emplace_back(value);
|
||||
this->mStorage.back().second.push_back(std::move(value));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void SerialQueue<T>::Enqueue(const std::vector<T>& values, Serial serial) {
|
||||
DAWN_ASSERT(values.size() > 0);
|
||||
DAWN_ASSERT(this->Empty() || this->mStorage.back().first <= serial);
|
||||
this->mStorage.emplace_back(SerialPair(serial, {values}));
|
||||
this->mStorage.emplace_back(serial, values);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void SerialQueue<T>::Enqueue(std::vector<T>&& values, Serial serial) {
|
||||
DAWN_ASSERT(values.size() > 0);
|
||||
DAWN_ASSERT(this->Empty() || this->mStorage.back().first <= serial);
|
||||
this->mStorage.emplace_back(SerialPair(serial, {values}));
|
||||
this->mStorage.emplace_back(serial, values);
|
||||
}
|
||||
|
||||
#endif // COMMON_SERIALQUEUE_H_
|
||||
|
||||
Reference in New Issue
Block a user