[dawn] Add nullable support to return types
Change return types to be more like RecordMember (type, annotation,
optional) rather than a raw Type. This requires a bunch of refactoring,
but now allows attaching that info to return types.
- Introduce a base class of RecordMember called AnnotatedTypedMember
that only has type, annotation, optional, and json_data.
- Change the representation of function/method return types from a Type
`.return_type` to an AnnotatedTypedMember `.returns`.
- Change the representation of void return to `None` instead of
`types['void']`.
- Change the return type of CreateBuffer from "buffer" to
{"type": "buffer", "optional": true}.
Bug: 427657664
Change-Id: Ifc3197139cdb3de5914c6bb33dd1b1c2dd20f1ce
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/249394
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Dawn is an open-source and cross-platform implementation of the WebGPU standard. More precisely it implements webgpu.h that is a one-to-one mapping with the WebGPU IDL. Dawn is meant to be integrated as part of a larger system and is the underlying implementation of WebGPU in Chromium.
Dawn provides several WebGPU building blocks:
webgpu.h version that Dawn implements.webgpu.h.Helpful links:
Developer documentation:
User documentation: (TODO, figure out what overlaps with the webgpu.h docs)
BSD 3-Clause License, please see LICENSE.
This is not an officially supported Google product.