//* Copyright 2020 The Dawn & Tint Authors
//*
//* Redistribution and use in source and binary forms, with or without
//* modification, are permitted provided that the following conditions are met:
//*
//* 1. Redistributions of source code must retain the above copyright notice, this
//*    list of conditions and the following disclaimer.
//*
//* 2. Redistributions in binary form must reproduce the above copyright notice,
//*    this list of conditions and the following disclaimer in the documentation
//*    and/or other materials provided with the distribution.
//*
//* 3. Neither the name of the copyright holder nor the names of its
//*    contributors may be used to endorse or promote products derived from
//*    this software without specific prior written permission.
//*
//* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
//* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
//* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
//* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
//* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
//* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
//* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
//* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
//* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
//* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//*
//*
//* This generator is used to produce a struct info file, in the format of
//* Emscripten's struct_info.json file, which is simply a list of struct fields
//* that it uses to generate field offset information for JS code generation.
//* <https://github.com/emscripten-core/emscripten/blob/main/src/struct_info.json>
//* It can be fed directly into gen_struct_info.py, or copy-pasted into the
//* struct_info.json as part of an update to Emscripten's built-in bindings.
//* <https://github.com/emscripten-core/emscripten/blob/main/system/include/webgpu/README.md>
//*
[
    // ===========================================
    // WebGPU
    //   NOTE: This file is auto-generated.
    //   See system/include/webgpu/README.md for details.
    // ===========================================
    {
        {% set api = metadata.api.lower() %}
        "file": "{{api}}/{{api}}.h",
        "defines": [],
        "structs": {
            "{{metadata.c_prefix}}ChainedStruct": [
                "next",
                "sType"
            ],
            {% for type in by_category["structure"] %}
                "{{as_cType(type.name)}}": [
                    {% if type.chained %}
                        "chain"
                    {%- elif type.extensible %}
                        "nextInChain"
                    {%- endif %}
                    {% for member in type.members -%}
                        {%- if (type.chained or type.extensible) or not loop.first -%}
                            ,
                        {% endif %}
                        "{{as_varName(member.name)}}"
                    {%- endfor %}

                ]
                {%- if not loop.last -%}
                    ,
                {% endif %}
            {% endfor %}

        }
    }
]
