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

@@ -39,10 +39,18 @@ void WireTest::SetUp() {
mS2cBuf = std::make_unique<utils::TerribleCommandBuffer>();
mC2sBuf = std::make_unique<utils::TerribleCommandBuffer>(mWireServer.get());
mWireServer.reset(new WireServer(mockDevice, mockProcs, mS2cBuf.get()));
WireServerDescriptor serverDesc = {};
serverDesc.device = mockDevice;
serverDesc.procs = &mockProcs;
serverDesc.serializer = mS2cBuf.get();
mWireServer.reset(new WireServer(serverDesc));
mC2sBuf->SetHandler(mWireServer.get());
mWireClient.reset(new WireClient(mC2sBuf.get()));
WireClientDescriptor clientDesc = {};
clientDesc.serializer = mC2sBuf.get();
mWireClient.reset(new WireClient(clientDesc));
mS2cBuf->SetHandler(mWireClient.get());
device = mWireClient->GetDevice();