blob: 3237412518a659ca2cc345979e30c5fd635db82a [file] [log] [blame]
Austin Engcc2516a2023-10-17 20:57:54 +00001// Copyright 2023 The Dawn & Tint Authors
dan sinclair774b6a42023-09-06 21:04:30 +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:
dan sinclair774b6a42023-09-06 21:04:30 +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.
dan sinclair774b6a42023-09-06 21:04:30 +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.
dan sinclair774b6a42023-09-06 21:04:30 +000027
28////////////////////////////////////////////////////////////////////////////////
29// File generated by 'tools/src/cmd/gen' using the template:
Ben Clayton9dce1d62023-09-21 12:41:20 +000030// src/tint/lang/spirv/builtin_fn.cc.tmpl
dan sinclair774b6a42023-09-06 21:04:30 +000031//
32// To regenerate run: './tools/run gen'
33//
34// Do not modify this file directly
35////////////////////////////////////////////////////////////////////////////////
36
Ben Clayton9dce1d62023-09-21 12:41:20 +000037#include "src/tint/lang/spirv/builtin_fn.h"
dan sinclair774b6a42023-09-06 21:04:30 +000038
Ben Clayton9dce1d62023-09-21 12:41:20 +000039namespace tint::spirv {
dan sinclair774b6a42023-09-06 21:04:30 +000040
Ben Clayton9dce1d62023-09-21 12:41:20 +000041const char* str(BuiltinFn i) {
dan sinclair774b6a42023-09-06 21:04:30 +000042 switch (i) {
Ben Clayton9dce1d62023-09-21 12:41:20 +000043 case BuiltinFn::kNone:
dan sinclair774b6a42023-09-06 21:04:30 +000044 return "<none>";
Ben Clayton9dce1d62023-09-21 12:41:20 +000045 case BuiltinFn::kArrayLength:
Ben Claytoneb447942023-09-25 11:43:19 +000046 return "array_length";
Ben Clayton9dce1d62023-09-21 12:41:20 +000047 case BuiltinFn::kAtomicAnd:
Ben Claytoneb447942023-09-25 11:43:19 +000048 return "atomic_and";
Ben Clayton9dce1d62023-09-21 12:41:20 +000049 case BuiltinFn::kAtomicCompareExchange:
Ben Claytoneb447942023-09-25 11:43:19 +000050 return "atomic_compare_exchange";
Ben Clayton9dce1d62023-09-21 12:41:20 +000051 case BuiltinFn::kAtomicExchange:
Ben Claytoneb447942023-09-25 11:43:19 +000052 return "atomic_exchange";
Ben Clayton9dce1d62023-09-21 12:41:20 +000053 case BuiltinFn::kAtomicIadd:
Ben Claytoneb447942023-09-25 11:43:19 +000054 return "atomic_iadd";
Ben Clayton9dce1d62023-09-21 12:41:20 +000055 case BuiltinFn::kAtomicIsub:
Ben Claytoneb447942023-09-25 11:43:19 +000056 return "atomic_isub";
Ben Clayton9dce1d62023-09-21 12:41:20 +000057 case BuiltinFn::kAtomicLoad:
Ben Claytoneb447942023-09-25 11:43:19 +000058 return "atomic_load";
Ben Clayton9dce1d62023-09-21 12:41:20 +000059 case BuiltinFn::kAtomicOr:
Ben Claytoneb447942023-09-25 11:43:19 +000060 return "atomic_or";
Ben Clayton9dce1d62023-09-21 12:41:20 +000061 case BuiltinFn::kAtomicSmax:
Ben Claytoneb447942023-09-25 11:43:19 +000062 return "atomic_smax";
Ben Clayton9dce1d62023-09-21 12:41:20 +000063 case BuiltinFn::kAtomicSmin:
Ben Claytoneb447942023-09-25 11:43:19 +000064 return "atomic_smin";
Ben Clayton9dce1d62023-09-21 12:41:20 +000065 case BuiltinFn::kAtomicStore:
Ben Claytoneb447942023-09-25 11:43:19 +000066 return "atomic_store";
Ben Clayton9dce1d62023-09-21 12:41:20 +000067 case BuiltinFn::kAtomicUmax:
Ben Claytoneb447942023-09-25 11:43:19 +000068 return "atomic_umax";
Ben Clayton9dce1d62023-09-21 12:41:20 +000069 case BuiltinFn::kAtomicUmin:
Ben Claytoneb447942023-09-25 11:43:19 +000070 return "atomic_umin";
Ben Clayton9dce1d62023-09-21 12:41:20 +000071 case BuiltinFn::kAtomicXor:
Ben Claytoneb447942023-09-25 11:43:19 +000072 return "atomic_xor";
Ben Clayton9dce1d62023-09-21 12:41:20 +000073 case BuiltinFn::kDot:
Ben Claytoneb447942023-09-25 11:43:19 +000074 return "dot";
Ben Clayton9dce1d62023-09-21 12:41:20 +000075 case BuiltinFn::kImageDrefGather:
Ben Claytoneb447942023-09-25 11:43:19 +000076 return "image_dref_gather";
Ben Clayton9dce1d62023-09-21 12:41:20 +000077 case BuiltinFn::kImageFetch:
Ben Claytoneb447942023-09-25 11:43:19 +000078 return "image_fetch";
Ben Clayton9dce1d62023-09-21 12:41:20 +000079 case BuiltinFn::kImageGather:
Ben Claytoneb447942023-09-25 11:43:19 +000080 return "image_gather";
Ben Clayton9dce1d62023-09-21 12:41:20 +000081 case BuiltinFn::kImageQuerySize:
Ben Claytoneb447942023-09-25 11:43:19 +000082 return "image_query_size";
Ben Clayton9dce1d62023-09-21 12:41:20 +000083 case BuiltinFn::kImageQuerySizeLod:
Ben Claytoneb447942023-09-25 11:43:19 +000084 return "image_query_size_lod";
Ben Clayton9dce1d62023-09-21 12:41:20 +000085 case BuiltinFn::kImageRead:
Ben Claytoneb447942023-09-25 11:43:19 +000086 return "image_read";
dan sinclair86d4f3b2023-09-21 16:46:52 +000087 case BuiltinFn::kImageSampleImplicitLod:
Ben Claytoneb447942023-09-25 11:43:19 +000088 return "image_sample_implicit_lod";
dan sinclair86d4f3b2023-09-21 16:46:52 +000089 case BuiltinFn::kImageSampleExplicitLod:
Ben Claytoneb447942023-09-25 11:43:19 +000090 return "image_sample_explicit_lod";
dan sinclair86d4f3b2023-09-21 16:46:52 +000091 case BuiltinFn::kImageSampleDrefImplicitLod:
Ben Claytoneb447942023-09-25 11:43:19 +000092 return "image_sample_dref_implicit_lod";
dan sinclair86d4f3b2023-09-21 16:46:52 +000093 case BuiltinFn::kImageSampleDrefExplicitLod:
Ben Claytoneb447942023-09-25 11:43:19 +000094 return "image_sample_dref_explicit_lod";
dan sinclair69502082023-09-21 16:48:42 +000095 case BuiltinFn::kImageWrite:
Ben Claytoneb447942023-09-25 11:43:19 +000096 return "image_write";
Ben Clayton9dce1d62023-09-21 12:41:20 +000097 case BuiltinFn::kMatrixTimesMatrix:
Ben Claytoneb447942023-09-25 11:43:19 +000098 return "matrix_times_matrix";
Ben Clayton9dce1d62023-09-21 12:41:20 +000099 case BuiltinFn::kMatrixTimesScalar:
Ben Claytoneb447942023-09-25 11:43:19 +0000100 return "matrix_times_scalar";
Ben Clayton9dce1d62023-09-21 12:41:20 +0000101 case BuiltinFn::kMatrixTimesVector:
Ben Claytoneb447942023-09-25 11:43:19 +0000102 return "matrix_times_vector";
Ben Clayton9dce1d62023-09-21 12:41:20 +0000103 case BuiltinFn::kSampledImage:
Ben Claytoneb447942023-09-25 11:43:19 +0000104 return "sampled_image";
Ben Clayton9dce1d62023-09-21 12:41:20 +0000105 case BuiltinFn::kSelect:
Ben Claytoneb447942023-09-25 11:43:19 +0000106 return "select";
Ben Clayton9dce1d62023-09-21 12:41:20 +0000107 case BuiltinFn::kVectorTimesMatrix:
Ben Claytoneb447942023-09-25 11:43:19 +0000108 return "vector_times_matrix";
Ben Clayton9dce1d62023-09-21 12:41:20 +0000109 case BuiltinFn::kVectorTimesScalar:
Ben Claytoneb447942023-09-25 11:43:19 +0000110 return "vector_times_scalar";
James Price650cb612023-09-26 19:19:16 +0000111 case BuiltinFn::kSdot:
112 return "sdot";
113 case BuiltinFn::kUdot:
114 return "udot";
dan sinclair774b6a42023-09-06 21:04:30 +0000115 }
116 return "<unknown>";
117}
118
Ben Clayton9dce1d62023-09-21 12:41:20 +0000119} // namespace tint::spirv