Add ability to generate typedefs from dawn.json

Can be used to help with deprecation during simple struct renames.

Includes typedefs for VertexAttributeDescriptor -> VertexAttribute and
VertexBufferLayoutDescriptor -> VertexBufferLayout as specified by the
latest RenderPipelineDescriptor changes.

Bug: dawn:642
Change-Id: Iab3d74d179884499540e813b0e66859713031ccb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/40581
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Brandon Jones
2021-02-08 19:48:06 +00:00
committed by Commit Bot service account
parent 734e88b2e7
commit 58a471ae25
5 changed files with 44 additions and 4 deletions

View File

@@ -63,6 +63,13 @@ namespace wgpu {
struct {{as_cppType(type.name)}};
{% endfor %}
{% for typeDef in by_category["typedef"] %}
// {{as_cppType(typeDef.name)}} is deprecated.
// Use {{as_cppType(typeDef.type.name)}} instead.
using {{as_cppType(typeDef.name)}} = {{as_cppType(typeDef.type.name)}};
{% endfor %}
template<typename Derived, typename CType>
class ObjectBase {
public: