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:
fujunwei
2021-12-05 05:29:44 +00:00
committed by Dawn LUCI CQ
parent 1c7d3efcd0
commit 3a464767a5
7 changed files with 45 additions and 31 deletions

View File

@@ -28,6 +28,7 @@ The `"_metadata"` key in the JSON file is used by flexible templates for generat
- `"api"` a string, the name of the Web API
- `"namespace"` a string, the namespace of C++ wrapper
- `"c_prefix"` (optional) a string, the prefix of C function and data type, it will default to upper-case of `"namespace"` if it's not provided.
- `"proc_table_prefix"` a string, the prefix of proc table.
- `"copyright_year"` (optional) a string, templates will use the the year of copyright.
The basic schema is that every entry is a thing with a `"category"` key what determines the sub-schema to apply to that thing. Categories and their sub-shema are defined below. Several parts of the schema use the concept of "record" which is a list of "record members" which are a combination of a type, a name and other metadata. For example the list of arguments of a function is a record. The list of structure members is a record. This combined concept is useful for the dawn_wire generator to generate code for structure and function calls in a very similar way.