Add dawnGetProcAddress.

This will become wgpuGetProcAddress that is part of the webgpu.h and the
last gap in functionality for dawn.h to match webgpu.h.

BUG=dawn:22

Change-Id: I0dcb3b5e6bd99cb10db273fc101d3ec0161b7da0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12120
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Corentin Wallez
2019-10-15 12:08:48 +00:00
committed by Commit Bot service account
parent 96496828a0
commit c57b180208
12 changed files with 296 additions and 8 deletions

View File

@@ -448,6 +448,12 @@ def c_native_methods(types, typ):
Method(Name('release'), types['void'], []),
]
def get_methods_sorted_by_name(api_params):
unsorted = [(as_MethodSuffix(typ.name, method.name), typ, method) \
for typ in api_params['by_category']['object'] \
for method in c_native_methods(api_params['types'], typ) ]
return [(typ, method) for (_, typ, method) in sorted(unsorted)]
class MultiGeneratorFromDawnJSON(Generator):
def get_description(self):
return 'Generates code for various target from Dawn.json.'
@@ -486,6 +492,7 @@ class MultiGeneratorFromDawnJSON(Generator):
'convert_cType_to_cppType': convert_cType_to_cppType,
'as_varName': as_varName,
'decorate': decorate,
'methods_sorted_by_name': get_methods_sorted_by_name(api_params),
}
renders = []