Support chained extension structs on the wire

This CL also adds a couple of dummy extensions in dawn.json so that
the serialization/deserialization in the wire can be tested.

Bug: dawn:369
Change-Id: I5ec3853c286f45d9b04e8bf9d04ebd9176dc917b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18520
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
diff --git a/generator/templates/webgpu_cpp.h b/generator/templates/webgpu_cpp.h
index 6bfcdb7..3dde1e8 100644
--- a/generator/templates/webgpu_cpp.h
+++ b/generator/templates/webgpu_cpp.h
@@ -204,7 +204,13 @@
                 ChainedStruct const * nextInChain = nullptr;
             {% endif %}
             {% for member in type.members %}
-                {{as_annotated_cppType(member)}}{{render_cpp_default_value(member)}};
+                {% set member_declaration = as_annotated_cppType(member) + render_cpp_default_value(member) %}
+                {% if type.chained and loop.first %}
+                    //* Align the first member to ChainedStruct to match the C struct layout.
+                    alignas(ChainedStruct) {{member_declaration}};
+                {% else %}
+                    {{member_declaration}};
+                {% endif %}
             {% endfor %}
         };