blob: 3e110b1ecc8cc9dbfb6a39a98fd21bfae5eeb393 [file] [log] [blame]
Austin Engcc2516a2023-10-17 20:57:54 +00001// Copyright 2021 The Dawn & Tint Authors
Ryan Harrisondbc13af2022-02-21 15:19:07 +00002//
Austin Engcc2516a2023-10-17 20:57:54 +00003// Redistribution and use in source and binary forms, with or without
4// modification, are permitted provided that the following conditions are met:
Ryan Harrisondbc13af2022-02-21 15:19:07 +00005//
Austin Engcc2516a2023-10-17 20:57:54 +00006// 1. Redistributions of source code must retain the above copyright notice, this
7// list of conditions and the following disclaimer.
Ryan Harrisondbc13af2022-02-21 15:19:07 +00008//
Austin Engcc2516a2023-10-17 20:57:54 +00009// 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 Harrisondbc13af2022-02-21 15:19:07 +000027
28////////////////////////////////////////////////////////////////////////////////
Ben Clayton57ded6a2023-08-22 13:22:22 +000029// File generated by 'tools/src/cmd/gen' using the template:
Ben Clayton015fbe72023-08-09 07:46:44 +000030// src/tint/lang/core/parameter_usage.h.tmpl
Ryan Harrisondbc13af2022-02-21 15:19:07 +000031//
Ben Clayton57ded6a2023-08-22 13:22:22 +000032// To regenerate run: './tools/run gen'
33//
34// Do not modify this file directly
Ryan Harrisondbc13af2022-02-21 15:19:07 +000035////////////////////////////////////////////////////////////////////////////////
36
Ben Clayton015fbe72023-08-09 07:46:44 +000037#ifndef SRC_TINT_LANG_CORE_PARAMETER_USAGE_H_
38#define SRC_TINT_LANG_CORE_PARAMETER_USAGE_H_
Ryan Harrisondbc13af2022-02-21 15:19:07 +000039
Stephan Hartmann9141e912023-08-14 15:56:22 +000040#include <cstdint>
Ben Clayton015fbe72023-08-09 07:46:44 +000041#include <string>
42
43#include "src/tint/utils/traits/traits.h"
44
45namespace tint::core {
Ryan Harrisondbc13af2022-02-21 15:19:07 +000046
47/// ParameterUsage is extra metadata for identifying a parameter based on its
48/// overload position
Ben Clayton0f8b6ef2023-08-10 14:12:42 +000049enum class ParameterUsage : uint8_t {
dan sinclair41e4d9a2022-05-01 14:40:55 +000050 kArrayIndex,
51 kBias,
dan sinclaire09d97e2024-07-18 03:38:32 +000052 kCompareValue,
dan sinclair41e4d9a2022-05-01 14:40:55 +000053 kComponent,
54 kCoords,
55 kDdx,
56 kDdy,
Natalie Chouinarddbefda92024-08-13 19:10:21 +000057 kDelta,
dan sinclair6bbb5d42024-07-11 16:12:10 +000058 kDepth,
dan sinclair41e4d9a2022-05-01 14:40:55 +000059 kDepthRef,
Natalie Chouinardb7114a62024-08-14 16:10:59 +000060 kE,
dan sinclair6bbb5d42024-07-11 16:12:10 +000061 kElements,
62 kHeight,
Natalie Chouinardb7114a62024-08-14 16:10:59 +000063 kId,
Le Hoang Quyenc2241312024-05-28 18:29:28 +000064 kInputAttachment,
dan sinclair41e4d9a2022-05-01 14:40:55 +000065 kLevel,
dan sinclaira108e6f2024-07-12 18:22:35 +000066 kLocation,
Natalie Chouinarddbefda92024-08-13 19:10:21 +000067 kMask,
dan sinclair6bbb5d42024-07-11 16:12:10 +000068 kNumLevels,
dan sinclair41e4d9a2022-05-01 14:40:55 +000069 kOffset,
dan sinclaire09d97e2024-07-18 03:38:32 +000070 kOriginalValue,
dan sinclair41e4d9a2022-05-01 14:40:55 +000071 kSampleIndex,
72 kSampler,
dan sinclair6bbb5d42024-07-11 16:12:10 +000073 kSamples,
David Netof72919f2023-09-14 16:52:23 +000074 kSourceLaneIndex,
dan sinclair41e4d9a2022-05-01 14:40:55 +000075 kTexture,
76 kValue,
Ben Clayton6ae608c2022-05-16 20:54:42 +000077 kW,
dan sinclair6bbb5d42024-07-11 16:12:10 +000078 kWidth,
Ben Clayton6ae608c2022-05-16 20:54:42 +000079 kX,
80 kXy,
81 kXyz,
82 kY,
83 kYz,
84 kZ,
85 kZw,
86 kZyw,
Ben Clayton0f8b6ef2023-08-10 14:12:42 +000087 kNone,
Ryan Harrisondbc13af2022-02-21 15:19:07 +000088};
89
Ben Clayton015fbe72023-08-09 07:46:44 +000090/// @param value the enum value
91/// @returns the string for the given enum value
92std::string_view ToString(ParameterUsage value);
Ryan Harrisondbc13af2022-02-21 15:19:07 +000093
Ben Clayton015fbe72023-08-09 07:46:44 +000094/// @param out the stream to write to
95/// @param value the ParameterUsage
96/// @returns @p out so calls can be chained
97template <typename STREAM, typename = traits::EnableIfIsOStream<STREAM>>
98auto& operator<<(STREAM& out, ParameterUsage value) {
99 return out << ToString(value);
100}
Ryan Harrisondbc13af2022-02-21 15:19:07 +0000101
Ben Clayton015fbe72023-08-09 07:46:44 +0000102} // namespace tint::core
103
104#endif // SRC_TINT_LANG_CORE_PARAMETER_USAGE_H_