Generate multiple variants of webgpu.h header

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 commit is contained in:
Kai Ninomiya
2021-09-17 19:44:43 +00:00
committed by Dawn LUCI CQ
parent 0a4cb8d859
commit 930e9186a6
11 changed files with 243 additions and 110 deletions

View File

@@ -11,7 +11,11 @@
//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//* See the License for the specific language governing permissions and
//* limitations under the License.
#include "dawn/webgpu_cpp.h"
{% if 'dawn' in enabled_tags %}
#include "dawn/webgpu_cpp.h"
{% else %}
#include "webgpu/webgpu_cpp.h"
{% endif %}
namespace wgpu {
{% for type in by_category["enum"] %}