blob: 036bf9b093606203ac96cb1eda17be685a71dde4 [file] [log] [blame]
Austin Eng544321a2024-04-27 16:46:27 +00001// Copyright 2023 The Dawn & Tint Authors
2//
3// Redistribution and use in source and binary forms, with or without
4// modification, are permitted provided that the following conditions are met:
5//
6// 1. Redistributions of source code must retain the above copyright notice, this
7// list of conditions and the following disclaimer.
8//
9// 2. Redistributions in binary form must reproduce the above copyright notice,
10// this list of conditions and the following disclaimer in the documentation
11// and/or other materials provided with the distribution.
12//
13// 3. Neither the name of the copyright holder nor the names of its
14// contributors may be used to endorse or promote products derived from
15// this software without specific prior written permission.
16//
17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loko Kung14ed5332023-05-16 04:50:32 +000027{% set API = metadata.api.upper() %}
28{% if 'dawn' in enabled_tags %}
29 #ifdef __EMSCRIPTEN__
30 #error "Do not include this header. Emscripten already provides headers needed for {{metadata.api}}."
31 #endif
32{% endif %}
33#ifndef {{API}}_CPP_CHAINED_STRUCT_H_
34#define {{API}}_CPP_CHAINED_STRUCT_H_
35
Loko Kung6f5515a2023-05-25 23:19:48 +000036#include <cstddef>
37#include <cstdint>
38
Loko Kung14ed5332023-05-16 04:50:32 +000039// This header file declares the ChainedStruct structures separately from the {{metadata.api}}
40// headers so that dependencies can directly extend structures without including the larger header
41// which exposes capabilities that may require correctly set proc tables.
42namespace {{metadata.namespace}} {
43
Loko Kung14ed5332023-05-16 04:50:32 +000044 enum class SType : uint32_t;
45
46 struct ChainedStruct {
47 ChainedStruct const * nextInChain = nullptr;
48 SType sType = SType(0u);
49 };
50
51 struct ChainedStructOut {
52 ChainedStructOut * nextInChain = nullptr;
53 SType sType = SType(0u);
54 };
55
56} // namespace {{metadata.namespace}}}
57
58#endif // {{API}}_CPP_CHAINED_STRUCT_H_