mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 10:25:28 +00:00
dawn_wire: use memcpy on structures when possible
This patch sets 'is_wire_transparent' on the structures whose members are all wire transparent and are not pointers, so that we can use memcpy when serializing and deserializing these structures: - GPUBlendComponent - GPUColor - GPUExtent3D - GPULimits - GPUOrigin3D - GPUStencilFaceState - GPUVertexAttribute - GPUBlendState In the next patch we will support memcpy on the qualified structures whose members contain pointers (e.g. GPUVertexBufferLayout). BUG=chromium:1266727 Change-Id: If46289f2d10cc7b17e6f5330cd2c2d4dc481f8b9 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/73000 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
b9467591a4
commit
1fa386cc87
@@ -242,6 +242,21 @@ class StructureType(Record, Type):
|
||||
# two nextInChain members.
|
||||
assert not (self.extensible and self.chained)
|
||||
|
||||
def update_metadata(self):
|
||||
Record.update_metadata(self)
|
||||
|
||||
if self.may_have_dawn_object:
|
||||
self.is_wire_transparent = False
|
||||
return
|
||||
|
||||
assert not (self.chained or self.extensible)
|
||||
|
||||
def get_is_wire_transparent(member):
|
||||
return member.type.is_wire_transparent and member.annotation == 'value'
|
||||
|
||||
self.is_wire_transparent = all(
|
||||
get_is_wire_transparent(m) for m in self.members)
|
||||
|
||||
@property
|
||||
def output(self):
|
||||
return self.chained == "out" or self.extensible == "out"
|
||||
|
||||
Reference in New Issue
Block a user