mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 01:15:39 +00:00
Make dawn.h closer to webgpu.h
This includes several changes to make dawn.h closer to webgpu.h (apart from the renames and copyright changes): - Make nextInChain follow the same type convention as the rest of the header. - Add defines that allow skipping the procs definition or the functions declaration part of the header. - Sort the methods by name for each object. - Put the callback definition inside extern "C" - Make the enums typedef have the name of the enum twice. BUG=dawn:22 Change-Id: I36e4587d60ca43886636ebd19d54752004f4696d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11903 Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
a83e0cdbcc
commit
97231682d0
@@ -195,6 +195,7 @@ def link_object(obj, types):
|
||||
|
||||
methods = [make_method(m) for m in obj.json_data.get('methods', [])]
|
||||
obj.methods = [method for method in methods if not is_native_method(method)]
|
||||
obj.methods.sort(key=lambda method: method.name.canonical_case())
|
||||
obj.native_methods = [method for method in methods if is_native_method(method)]
|
||||
|
||||
def link_structure(struct, types):
|
||||
@@ -439,7 +440,7 @@ def as_wireType(typ):
|
||||
return as_cppType(typ.name)
|
||||
|
||||
def cpp_native_methods(types, typ):
|
||||
return typ.methods + typ.native_methods
|
||||
return sorted(typ.methods + typ.native_methods, key=lambda method: method.name.canonical_case())
|
||||
|
||||
def c_native_methods(types, typ):
|
||||
return cpp_native_methods(types, typ) + [
|
||||
|
||||
Reference in New Issue
Block a user