Loko Kung | 14ed533 | 2023-05-16 04:50:32 +0000 | [diff] [blame] | 1 | //* Copyright 2023 The Dawn Authors |
| 2 | //* |
| 3 | //* Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | //* you may not use this file except in compliance with the License. |
| 5 | //* You may obtain a copy of the License at |
| 6 | //* |
| 7 | //* http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | //* |
| 9 | //* Unless required by applicable law or agreed to in writing, software |
| 10 | //* distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | //* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | //* See the License for the specific language governing permissions and |
| 13 | //* limitations under the License. |
| 14 | {% set API = metadata.api.upper() %} |
| 15 | {% if 'dawn' in enabled_tags %} |
| 16 | #ifdef __EMSCRIPTEN__ |
| 17 | #error "Do not include this header. Emscripten already provides headers needed for {{metadata.api}}." |
| 18 | #endif |
| 19 | {% endif %} |
| 20 | #ifndef {{API}}_CPP_CHAINED_STRUCT_H_ |
| 21 | #define {{API}}_CPP_CHAINED_STRUCT_H_ |
| 22 | |
Loko Kung | 6f5515a | 2023-05-25 23:19:48 +0000 | [diff] [blame] | 23 | #include <cstddef> |
| 24 | #include <cstdint> |
| 25 | |
Loko Kung | 14ed533 | 2023-05-16 04:50:32 +0000 | [diff] [blame] | 26 | // This header file declares the ChainedStruct structures separately from the {{metadata.api}} |
| 27 | // headers so that dependencies can directly extend structures without including the larger header |
| 28 | // which exposes capabilities that may require correctly set proc tables. |
| 29 | namespace {{metadata.namespace}} { |
| 30 | |
Loko Kung | 14ed533 | 2023-05-16 04:50:32 +0000 | [diff] [blame] | 31 | enum class SType : uint32_t; |
| 32 | |
| 33 | struct ChainedStruct { |
| 34 | ChainedStruct const * nextInChain = nullptr; |
| 35 | SType sType = SType(0u); |
| 36 | }; |
| 37 | |
| 38 | struct ChainedStructOut { |
| 39 | ChainedStructOut * nextInChain = nullptr; |
| 40 | SType sType = SType(0u); |
| 41 | }; |
| 42 | |
| 43 | } // namespace {{metadata.namespace}}} |
| 44 | |
| 45 | #endif // {{API}}_CPP_CHAINED_STRUCT_H_ |