Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 1 | // Copyright 2021 The Dawn & Tint Authors |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2 | // |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 3 | // Redistribution and use in source and binary forms, with or without |
| 4 | // modification, are permitted provided that the following conditions are met: |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 5 | // |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 6 | // 1. Redistributions of source code must retain the above copyright notice, this |
| 7 | // list of conditions and the following disclaimer. |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 8 | // |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 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. |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 27 | |
| 28 | //////////////////////////////////////////////////////////////////////////////// |
Ben Clayton | 57ded6a | 2023-08-22 13:22:22 +0000 | [diff] [blame] | 29 | // File generated by 'tools/src/cmd/gen' using the template: |
Ben Clayton | 015fbe7 | 2023-08-09 07:46:44 +0000 | [diff] [blame] | 30 | // src/tint/lang/core/parameter_usage.h.tmpl |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 31 | // |
Ben Clayton | 57ded6a | 2023-08-22 13:22:22 +0000 | [diff] [blame] | 32 | // To regenerate run: './tools/run gen' |
| 33 | // |
| 34 | // Do not modify this file directly |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 35 | //////////////////////////////////////////////////////////////////////////////// |
| 36 | |
Ben Clayton | 015fbe7 | 2023-08-09 07:46:44 +0000 | [diff] [blame] | 37 | #ifndef SRC_TINT_LANG_CORE_PARAMETER_USAGE_H_ |
| 38 | #define SRC_TINT_LANG_CORE_PARAMETER_USAGE_H_ |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 39 | |
Stephan Hartmann | 9141e91 | 2023-08-14 15:56:22 +0000 | [diff] [blame] | 40 | #include <cstdint> |
Ben Clayton | 015fbe7 | 2023-08-09 07:46:44 +0000 | [diff] [blame] | 41 | #include <string> |
| 42 | |
| 43 | #include "src/tint/utils/traits/traits.h" |
| 44 | |
| 45 | namespace tint::core { |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 46 | |
| 47 | /// ParameterUsage is extra metadata for identifying a parameter based on its |
| 48 | /// overload position |
Ben Clayton | 0f8b6ef | 2023-08-10 14:12:42 +0000 | [diff] [blame] | 49 | enum class ParameterUsage : uint8_t { |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 50 | kArrayIndex, |
| 51 | kBias, |
dan sinclair | e09d97e | 2024-07-18 03:38:32 +0000 | [diff] [blame] | 52 | kCompareValue, |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 53 | kComponent, |
| 54 | kCoords, |
| 55 | kDdx, |
| 56 | kDdy, |
Natalie Chouinard | dbefda9 | 2024-08-13 19:10:21 +0000 | [diff] [blame] | 57 | kDelta, |
dan sinclair | 6bbb5d4 | 2024-07-11 16:12:10 +0000 | [diff] [blame] | 58 | kDepth, |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 59 | kDepthRef, |
Natalie Chouinard | b7114a6 | 2024-08-14 16:10:59 +0000 | [diff] [blame] | 60 | kE, |
dan sinclair | 6bbb5d4 | 2024-07-11 16:12:10 +0000 | [diff] [blame] | 61 | kElements, |
| 62 | kHeight, |
Natalie Chouinard | b7114a6 | 2024-08-14 16:10:59 +0000 | [diff] [blame] | 63 | kId, |
Le Hoang Quyen | c224131 | 2024-05-28 18:29:28 +0000 | [diff] [blame] | 64 | kInputAttachment, |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 65 | kLevel, |
dan sinclair | a108e6f | 2024-07-12 18:22:35 +0000 | [diff] [blame] | 66 | kLocation, |
Natalie Chouinard | dbefda9 | 2024-08-13 19:10:21 +0000 | [diff] [blame] | 67 | kMask, |
dan sinclair | 6bbb5d4 | 2024-07-11 16:12:10 +0000 | [diff] [blame] | 68 | kNumLevels, |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 69 | kOffset, |
dan sinclair | e09d97e | 2024-07-18 03:38:32 +0000 | [diff] [blame] | 70 | kOriginalValue, |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 71 | kSampleIndex, |
| 72 | kSampler, |
dan sinclair | 6bbb5d4 | 2024-07-11 16:12:10 +0000 | [diff] [blame] | 73 | kSamples, |
David Neto | f72919f | 2023-09-14 16:52:23 +0000 | [diff] [blame] | 74 | kSourceLaneIndex, |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 75 | kTexture, |
| 76 | kValue, |
Ben Clayton | 6ae608c | 2022-05-16 20:54:42 +0000 | [diff] [blame] | 77 | kW, |
dan sinclair | 6bbb5d4 | 2024-07-11 16:12:10 +0000 | [diff] [blame] | 78 | kWidth, |
Ben Clayton | 6ae608c | 2022-05-16 20:54:42 +0000 | [diff] [blame] | 79 | kX, |
| 80 | kXy, |
| 81 | kXyz, |
| 82 | kY, |
| 83 | kYz, |
| 84 | kZ, |
| 85 | kZw, |
| 86 | kZyw, |
Ben Clayton | 0f8b6ef | 2023-08-10 14:12:42 +0000 | [diff] [blame] | 87 | kNone, |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 88 | }; |
| 89 | |
Ben Clayton | 015fbe7 | 2023-08-09 07:46:44 +0000 | [diff] [blame] | 90 | /// @param value the enum value |
| 91 | /// @returns the string for the given enum value |
| 92 | std::string_view ToString(ParameterUsage value); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 93 | |
Ben Clayton | 015fbe7 | 2023-08-09 07:46:44 +0000 | [diff] [blame] | 94 | /// @param out the stream to write to |
| 95 | /// @param value the ParameterUsage |
| 96 | /// @returns @p out so calls can be chained |
| 97 | template <typename STREAM, typename = traits::EnableIfIsOStream<STREAM>> |
| 98 | auto& operator<<(STREAM& out, ParameterUsage value) { |
| 99 | return out << ToString(value); |
| 100 | } |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 101 | |
Ben Clayton | 015fbe7 | 2023-08-09 07:46:44 +0000 | [diff] [blame] | 102 | } // namespace tint::core |
| 103 | |
| 104 | #endif // SRC_TINT_LANG_CORE_PARAMETER_USAGE_H_ |