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

@@ -121,10 +121,18 @@ dawn::Device CreateCppDawnDevice() {
c2sBuf = new utils::TerribleCommandBuffer();
s2cBuf = new utils::TerribleCommandBuffer();
wireServer = new dawn_wire::WireServer(backendDevice, backendProcs, s2cBuf);
dawn_wire::WireServerDescriptor serverDesc = {};
serverDesc.device = backendDevice;
serverDesc.procs = &backendProcs;
serverDesc.serializer = s2cBuf;
wireServer = new dawn_wire::WireServer(serverDesc);
c2sBuf->SetHandler(wireServer);
wireClient = new dawn_wire::WireClient(c2sBuf);
dawn_wire::WireClientDescriptor clientDesc = {};
clientDesc.serializer = c2sBuf;
wireClient = new dawn_wire::WireClient(clientDesc);
DawnDevice clientDevice = wireClient->GetDevice();
DawnProcTable clientProcs = wireClient->GetProcs();
s2cBuf->SetHandler(wireClient);