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>
diff --git a/generator/templates/webgpu_cpp.h b/generator/templates/webgpu_cpp.h
index 3e6b80c..40b804f 100644
--- a/generator/templates/webgpu_cpp.h
+++ b/generator/templates/webgpu_cpp.h
@@ -63,6 +63,13 @@
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: