Adds a "tag" system so that entries of dawn.json can be conditionally
emitted in different configurations. With a few more dawn.json changes,
this will enable generating the exact upstream header.
Bug: dawn:1080
Change-Id: I3506dadd485e31786578a3a64c3603c964c5354f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62580
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This CL adds two helpers for more ergonomic processing of
ChainedStructs.
1. FindInChain(): Iterates through the chain and automatically
casts the ChainedStruct into the appropriate child type before
returning.
2. ValidateSTypes(): Verifies that the chain only contains structs
with sTypes from a pre-defined set. This also allows the caller
to specify one-of constraints.
3. ValidateSingleSType(): Verifies that the chain contains a
single struct with a specific sType or is an empty chain. This
is a common case of |ValidateSTypes()| and is separated out as
a fast-path.
Change-Id: I938df0bf2a9b1800b1105fb7f80fbde20bef8ec8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47680
Commit-Queue: Brian Ho <hob@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Also does small cleanups in dawn.json
Bug: None
Change-Id: Icbe8c9370496fa63fdd32b43d4f7a0666acf71c4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45920
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>