Add MemoryTransfer interfaces to the wire

This patch adds MemoryTransfer client/server interfaces and
uses it to implement data transfers for buffer mapping.

This patch also provides a default "inline" implementation of
the MemoryTransfer which is used if the embedder does not
provide one on initialization.

Because implementations of MemoryTransfer perform their own
serialization, a skip_serialize option is added to WireCmd records.

Bug: dawn:156
Change-Id: I2fa035517628a3ad465b0bc18a6ffc477e2bd67f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8642
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Austin Eng
2019-07-19 16:01:48 +00:00
committed by Commit Bot service account
parent 49aae0f3bd
commit 6a5418a760
25 changed files with 874 additions and 211 deletions

View File

@@ -73,8 +73,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
ASSERT(nullDevice.Get() != nullptr);
DevNull devNull;
std::unique_ptr<dawn_wire::WireServer> wireServer(
new dawn_wire::WireServer(nullDevice.Get(), procs, &devNull));
dawn_wire::WireServerDescriptor serverDesc = {};
serverDesc.device = nullDevice.Get();
serverDesc.procs = &procs;
serverDesc.serializer = &devNull;
std::unique_ptr<dawn_wire::WireServer> wireServer(new dawn_wire::WireServer(serverDesc));
wireServer->HandleCommands(reinterpret_cast<const char*>(data), size);