mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 02:15:43 +00:00
Make the prefix of proc table configurable in api.json
Add a metadata to configure the prefix of proc table and Make proc table flexiable with the prefix and declared functions. BUG=dawn:1201 Change-Id: Id28e5521506fa5dc8efca90a7883fbd3dd548e8d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71526 Commit-Queue: Junwei Fu <junwei.fu@intel.com> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
@@ -28,6 +28,7 @@ class Metadata:
|
||||
self.api = metadata['api']
|
||||
self.namespace = metadata['namespace']
|
||||
self.c_prefix = metadata.get('c_prefix', self.namespace.upper())
|
||||
self.proc_table_prefix = metadata['proc_table_prefix']
|
||||
self.copyright_year = metadata.get('copyright_year', None)
|
||||
|
||||
|
||||
@@ -759,12 +760,13 @@ class MultiGeneratorFromDawnJSON(Generator):
|
||||
|
||||
api_file_name = metadata.api.lower()
|
||||
if 'dawn_headers' in targets:
|
||||
prefix = metadata.proc_table_prefix.lower()
|
||||
renders.append(
|
||||
FileRender('api.h', 'src/include/dawn/' + api_file_name + '.h',
|
||||
[RENDER_PARAMS_BASE, params_dawn]))
|
||||
renders.append(
|
||||
FileRender('dawn_proc_table.h',
|
||||
'src/include/dawn/dawn_proc_table.h',
|
||||
'src/include/dawn/' + prefix + '_proc_table.h',
|
||||
[RENDER_PARAMS_BASE, params_dawn]))
|
||||
|
||||
if 'dawncpp_headers' in targets:
|
||||
|
||||
Reference in New Issue
Block a user