/src/dawn/src/tint/lang/spirv/intrinsic/dialect.h
Line | Count | Source (jump to first uncovered line) |
1 | | // Copyright 2023 The Tint 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 | | |
15 | | #ifndef SRC_TINT_LANG_SPIRV_INTRINSIC_DIALECT_H_ |
16 | | #define SRC_TINT_LANG_SPIRV_INTRINSIC_DIALECT_H_ |
17 | | |
18 | | #include "src/tint/lang/core/intrinsic/table_data.h" |
19 | | #include "src/tint/lang/spirv/builtin_fn.h" |
20 | | |
21 | | namespace tint::spirv::intrinsic { |
22 | | |
23 | | /// Dialect holds the intrinsic table data and types for the SPIR-V dialect |
24 | | struct Dialect { |
25 | | /// The dialect's intrinsic table data |
26 | | static const core::intrinsic::TableData kData; |
27 | | |
28 | | /// The dialect's builtin function enumerator |
29 | | using BuiltinFn = spirv::BuiltinFn; |
30 | | |
31 | | /// @returns the name of the builtin function @p fn |
32 | | /// @param fn the builtin function |
33 | 0 | static std::string_view ToString(BuiltinFn fn) { return str(fn); } |
34 | | }; |
35 | | |
36 | | } // namespace tint::spirv::intrinsic |
37 | | |
38 | | #endif // SRC_TINT_LANG_SPIRV_INTRINSIC_DIALECT_H_ |