Nuke Builders Part 2: remove all builder code from wire
This removes blocks of code that were obviously builder-specific but
also removes the ObjectStorage::valid member that was used to implement
the maybe monad on the wire server side. This is no longer needed since
dawn_native handles the maybe monad internally now.
BUG=dawn:125
Change-Id: I8c30daae9fc70853bc1996d85a860b4877c5976c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6161
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn_wire/server/ObjectStorage.h b/src/dawn_wire/server/ObjectStorage.h
index 4bfce34..689dc0b 100644
--- a/src/dawn_wire/server/ObjectStorage.h
+++ b/src/dawn_wire/server/ObjectStorage.h
@@ -15,7 +15,6 @@
#ifndef DAWNWIRE_SERVER_OBJECTSTORAGE_H_
#define DAWNWIRE_SERVER_OBJECTSTORAGE_H_
-#include "dawn_wire/TypeTraits_autogen.h"
#include "dawn_wire/WireCmd_autogen.h"
#include <algorithm>
@@ -29,26 +28,17 @@
T handle;
uint32_t serial = 0;
- // Used by the error-propagation mechanism to know if this object is an error.
- // TODO(cwallez@chromium.org): this is doubling the memory usage of
- // std::vector<ObjectDataBase> consider making it a special marker value in handle instead.
- bool valid;
// Whether this object has been allocated, used by the KnownObjects queries
// TODO(cwallez@chromium.org): make this an internal bit vector in KnownObjects.
bool allocated;
};
// Stores what the backend knows about the type.
- template <typename T, bool IsBuilder = IsBuilderType<T>::value>
+ template <typename T>
struct ObjectData : public ObjectDataBase<T> {};
- template <typename T>
- struct ObjectData<T, true> : public ObjectDataBase<T> {
- ObjectHandle builtObject = ObjectHandle{0, 0};
- };
-
template <>
- struct ObjectData<DawnBuffer, false> : public ObjectDataBase<DawnBuffer> {
+ struct ObjectData<DawnBuffer> : public ObjectDataBase<DawnBuffer> {
void* mappedData = nullptr;
size_t mappedDataSize = 0;
};
@@ -65,7 +55,6 @@
// KnownObjects for ID 0.
Data reservation;
reservation.handle = nullptr;
- reservation.valid = false;
reservation.allocated = false;
mKnown.push_back(reservation);
}
@@ -109,7 +98,6 @@
Data data;
data.allocated = true;
- data.valid = false;
data.handle = nullptr;
if (id >= mKnown.size()) {
@@ -136,7 +124,6 @@
for (Data& data : mKnown) {
if (data.allocated && data.handle != nullptr) {
objects.push_back(data.handle);
- data.valid = false;
data.allocated = false;
data.handle = nullptr;
}