dan sinclair | 9d3ffa6 | 2024-09-16 19:11:34 +0000 | [diff] [blame] | 1 | // Copyright 2024 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. |
| 27 | |
| 28 | //////////////////////////////////////////////////////////////////////////////// |
| 29 | // File generated by 'tools/src/cmd/gen' using the template: |
| 30 | // src/tint/lang/glsl/builtin_fn.cc.tmpl |
| 31 | // |
| 32 | // To regenerate run: './tools/run gen' |
| 33 | // |
| 34 | // Do not modify this file directly |
| 35 | //////////////////////////////////////////////////////////////////////////////// |
| 36 | |
| 37 | #include "src/tint/lang/glsl/builtin_fn.h" |
| 38 | |
| 39 | namespace tint::glsl { |
| 40 | |
| 41 | const char* str(BuiltinFn i) { |
| 42 | switch (i) { |
| 43 | case BuiltinFn::kNone: |
| 44 | return "<none>"; |
dan sinclair | da2fa97 | 2024-09-23 16:35:35 +0000 | [diff] [blame] | 45 | case BuiltinFn::kLength: |
| 46 | return "length"; |
dan sinclair | 9d3ffa6 | 2024-09-16 19:11:34 +0000 | [diff] [blame] | 47 | case BuiltinFn::kBarrier: |
| 48 | return "barrier"; |
| 49 | case BuiltinFn::kMemoryBarrierBuffer: |
| 50 | return "memoryBarrierBuffer"; |
| 51 | case BuiltinFn::kMemoryBarrierImage: |
| 52 | return "memoryBarrierImage"; |
dan sinclair | 7b7fb81 | 2024-09-16 19:43:49 +0000 | [diff] [blame] | 53 | case BuiltinFn::kAtomicCompSwap: |
| 54 | return "atomicCompSwap"; |
| 55 | case BuiltinFn::kAtomicSub: |
| 56 | return "atomicSub"; |
dan sinclair | 562d9b7 | 2024-09-17 22:33:56 +0000 | [diff] [blame] | 57 | case BuiltinFn::kFloatBitsToInt: |
| 58 | return "floatBitsToInt"; |
| 59 | case BuiltinFn::kFloatBitsToUint: |
| 60 | return "floatBitsToUint"; |
| 61 | case BuiltinFn::kIntBitsToFloat: |
| 62 | return "intBitsToFloat"; |
| 63 | case BuiltinFn::kUintBitsToFloat: |
| 64 | return "uintBitsToFloat"; |
dan sinclair | 416092b | 2024-09-18 02:36:45 +0000 | [diff] [blame] | 65 | case BuiltinFn::kBitCount: |
| 66 | return "bitCount"; |
dan sinclair | dd143d2 | 2024-09-18 04:34:45 +0000 | [diff] [blame] | 67 | case BuiltinFn::kBitfieldExtract: |
| 68 | return "bitfieldExtract"; |
dan sinclair | 5bc6476 | 2024-09-18 04:34:52 +0000 | [diff] [blame] | 69 | case BuiltinFn::kBitfieldInsert: |
| 70 | return "bitfieldInsert"; |
dan sinclair | 9ae5b84 | 2024-09-17 23:49:20 +0000 | [diff] [blame] | 71 | case BuiltinFn::kPackFloat2X16: |
| 72 | return "packFloat2x16"; |
| 73 | case BuiltinFn::kUnpackFloat2X16: |
| 74 | return "unpackFloat2x16"; |
dan sinclair | 8879b18 | 2024-09-25 14:35:19 +0000 | [diff] [blame] | 75 | case BuiltinFn::kAbs: |
| 76 | return "abs"; |
dan sinclair | fa3e144 | 2024-09-24 22:59:17 +0000 | [diff] [blame] | 77 | case BuiltinFn::kAny: |
| 78 | return "any"; |
| 79 | case BuiltinFn::kAll: |
| 80 | return "all"; |
dan sinclair | e0ca165 | 2024-09-24 20:37:31 +0000 | [diff] [blame] | 81 | case BuiltinFn::kDot: |
| 82 | return "dot"; |
dan sinclair | a6300bf | 2024-09-27 23:48:30 +0000 | [diff] [blame] | 83 | case BuiltinFn::kMix: |
| 84 | return "mix"; |
dan sinclair | 8ce2ed7 | 2024-09-24 20:40:08 +0000 | [diff] [blame] | 85 | case BuiltinFn::kModf: |
| 86 | return "modf"; |
dan sinclair | 5deac0c | 2024-09-25 14:31:01 +0000 | [diff] [blame] | 87 | case BuiltinFn::kFrexp: |
| 88 | return "frexp"; |
dan sinclair | 8055bf4 | 2024-10-08 01:52:48 +0000 | [diff] [blame] | 89 | case BuiltinFn::kTexture: |
| 90 | return "texture"; |
| 91 | case BuiltinFn::kTextureOffset: |
| 92 | return "textureOffset"; |
dan sinclair | ec448b1 | 2024-10-08 02:52:12 +0000 | [diff] [blame] | 93 | case BuiltinFn::kTextureLod: |
| 94 | return "textureLod"; |
| 95 | case BuiltinFn::kExtTextureLod: |
| 96 | return "extTextureLod"; |
| 97 | case BuiltinFn::kTextureLodOffset: |
| 98 | return "textureLodOffset"; |
| 99 | case BuiltinFn::kExtTextureLodOffset: |
| 100 | return "extTextureLodOffset"; |
dan sinclair | b6fc95f | 2024-10-08 03:38:53 +0000 | [diff] [blame] | 101 | case BuiltinFn::kTextureGrad: |
| 102 | return "textureGrad"; |
dan sinclair | 8055bf4 | 2024-10-08 01:52:48 +0000 | [diff] [blame] | 103 | case BuiltinFn::kTextureGradOffset: |
| 104 | return "textureGradOffset"; |
dan sinclair | 144db47 | 2024-10-07 19:57:55 +0000 | [diff] [blame] | 105 | case BuiltinFn::kTextureGather: |
| 106 | return "textureGather"; |
| 107 | case BuiltinFn::kTextureGatherOffset: |
| 108 | return "textureGatherOffset"; |
dan sinclair | 8124737 | 2024-09-18 00:01:43 +0000 | [diff] [blame] | 109 | case BuiltinFn::kTextureSize: |
| 110 | return "textureSize"; |
| 111 | case BuiltinFn::kImageSize: |
| 112 | return "imageSize"; |
dan sinclair | a5afb1f | 2024-09-20 04:34:34 +0000 | [diff] [blame] | 113 | case BuiltinFn::kTexelFetch: |
| 114 | return "texelFetch"; |
| 115 | case BuiltinFn::kImageLoad: |
| 116 | return "imageLoad"; |
dan sinclair | d13c9f9 | 2024-09-20 05:00:42 +0000 | [diff] [blame] | 117 | case BuiltinFn::kImageStore: |
| 118 | return "imageStore"; |
dan sinclair | 803ff2b | 2024-09-23 18:37:22 +0000 | [diff] [blame] | 119 | case BuiltinFn::kLessThan: |
| 120 | return "lessThan"; |
| 121 | case BuiltinFn::kLessThanEqual: |
| 122 | return "lessThanEqual"; |
| 123 | case BuiltinFn::kGreaterThan: |
| 124 | return "greaterThan"; |
| 125 | case BuiltinFn::kGreaterThanEqual: |
| 126 | return "greaterThanEqual"; |
| 127 | case BuiltinFn::kEqual: |
| 128 | return "equal"; |
| 129 | case BuiltinFn::kNotEqual: |
| 130 | return "notEqual"; |
dan sinclair | 9d3ffa6 | 2024-09-16 19:11:34 +0000 | [diff] [blame] | 131 | } |
| 132 | return "<unknown>"; |
| 133 | } |
| 134 | |
| 135 | } // namespace tint::glsl |