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/generator/dawn_json_generator.py b/generator/dawn_json_generator.py
index 8b78796..44d887e 100644
--- a/generator/dawn_json_generator.py
+++ b/generator/dawn_json_generator.py
@@ -95,7 +95,8 @@
# method arguments or structure members.
class RecordMember:
def __init__(self, name, typ, annotation, optional=False,
- is_return_value=False, default_value=None):
+ is_return_value=False, default_value=None,
+ skip_serialize=False):
self.name = name
self.type = typ
self.annotation = annotation
@@ -104,6 +105,7 @@
self.is_return_value = is_return_value
self.handle_type = None
self.default_value = default_value
+ self.skip_serialize = skip_serialize
def set_handle_type(self, handle_type):
assert self.type.dict_name == "ObjectHandle"
@@ -155,7 +157,8 @@
m.get('annotation', 'value'),
optional=m.get('optional', False),
is_return_value=m.get('is_return_value', False),
- default_value=m.get('default', None))
+ default_value=m.get('default', None),
+ skip_serialize=m.get('skip_serialize', False))
handle_type = m.get('handle_type')
if handle_type:
member.set_handle_type(types[handle_type])