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>
diff --git a/dawn_wire.json b/dawn_wire.json
index e178732..55bb452 100644
--- a/dawn_wire.json
+++ b/dawn_wire.json
@@ -18,7 +18,9 @@
"buffer map async": [
{ "name": "buffer id", "type": "ObjectId" },
{ "name": "request serial", "type": "uint32_t" },
- { "name": "is write", "type": "bool" }
+ { "name": "is write", "type": "bool" },
+ { "name": "handle create info length", "type": "uint64_t" },
+ { "name": "handle create info", "type": "uint8_t", "annotation": "const*", "length": "handle create info length", "skip_serialize": true}
],
"buffer set sub data internal": [
{"name": "buffer id", "type": "ObjectId" },
@@ -28,19 +30,23 @@
],
"buffer update mapped data": [
{ "name": "buffer id", "type": "ObjectId" },
- { "name": "data length", "type": "uint32_t" },
- { "name": "data", "type": "uint8_t", "annotation": "const*", "length": "data length" }
+ { "name": "write flush info length", "type": "uint64_t" },
+ { "name": "write flush info", "type": "uint8_t", "annotation": "const*", "length": "write flush info length", "skip_serialize": true}
],
"device create buffer mapped": [
{ "name": "device", "type": "device" },
{ "name": "descriptor", "type": "buffer descriptor", "annotation": "const*" },
- { "name": "result", "type": "ObjectHandle", "handle_type": "buffer" }
+ { "name": "result", "type": "ObjectHandle", "handle_type": "buffer" },
+ { "name": "handle create info length", "type": "uint64_t" },
+ { "name": "handle create info", "type": "uint8_t", "annotation": "const*", "length": "handle create info length", "skip_serialize": true}
],
"device create buffer mapped async": [
{ "name": "device", "type": "device" },
{ "name": "descriptor", "type": "buffer descriptor", "annotation": "const*" },
{ "name": "request serial", "type": "uint32_t" },
- { "name": "result", "type": "ObjectHandle", "handle_type": "buffer" }
+ { "name": "result", "type": "ObjectHandle", "handle_type": "buffer" },
+ { "name": "handle create info length", "type": "uint64_t" },
+ { "name": "handle create info", "type": "uint8_t", "annotation": "const*", "length": "handle create info length", "skip_serialize": true}
],
"destroy object": [
{ "name": "object type", "type": "ObjectType" },
@@ -52,14 +58,13 @@
{ "name": "buffer", "type": "ObjectHandle", "handle_type": "buffer" },
{ "name": "request serial", "type": "uint32_t" },
{ "name": "status", "type": "uint32_t" },
- { "name": "data length", "type": "uint64_t" },
- { "name": "data", "type": "uint8_t", "annotation": "const*", "length": "data length" }
+ { "name": "initial data info length", "type": "uint64_t" },
+ { "name": "initial data info", "type": "uint8_t", "annotation": "const*", "length": "initial data info length", "skip_serialize": true }
],
"buffer map write async callback": [
{ "name": "buffer", "type": "ObjectHandle", "handle_type": "buffer" },
{ "name": "request serial", "type": "uint32_t" },
- { "name": "status", "type": "uint32_t" },
- { "name": "data length", "type": "uint64_t" }
+ { "name": "status", "type": "uint32_t" }
],
"device error callback": [
{ "name": "message", "type": "char", "annotation": "const*", "length": "strlen" }
@@ -80,6 +85,7 @@
"client_handwritten_commands": [
"BufferSetSubData",
"BufferUnmap",
+ "DeviceCreateBuffer",
"DeviceCreateBufferMapped",
"DeviceCreateBufferMappedAsync",
"QueueCreateFence",