mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 10:25:28 +00:00
Support "length" in dawn.json could be a integer
Struct member defined in dawn.json could have a 'length' attribute defines the length of the member if it is an array. In previous, the 'length' could only be 'strlen' or other variable which has 'uint32_t' types. It cannot support constant length. CopyTextureForBrowserOptions transfers conversion parameters and conversion matrix with a constant length. This CL adds this ability to meet such requirements. Bug: dawn:1140 Change-Id: I6eeabbc55cc3853fe15e33bdd44060b16f6096bf Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/72580 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
This commit is contained in:
@@ -297,6 +297,10 @@ def linked_record_members(json_data, types):
|
||||
assert False
|
||||
elif m['length'] == 'strlen':
|
||||
member.length = 'strlen'
|
||||
elif isinstance(m['length'], int):
|
||||
assert m['length'] > 0
|
||||
member.length = "constant"
|
||||
member.constant_length = m['length']
|
||||
else:
|
||||
member.length = members_by_name[m['length']]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user