blob: 566bd9b9876af2c59805699e552383606e3afc35 [file] [log] [blame]
{{- /*
--------------------------------------------------------------------------------
Template file for use with tools/src/cmd/gen to generate builtin_fn.h
To update the generated file, run:
./tools/run gen
See:
* tools/src/cmd/gen for structures used by this template
* https://golang.org/pkg/text/template/ for documentation on the template syntax
--------------------------------------------------------------------------------
*/ -}}
{{- $I := LoadIntrinsics "src/tint/lang/hlsl/hlsl.def" -}}
#ifndef SRC_TINT_LANG_HLSL_BUILTIN_FN_H_
#define SRC_TINT_LANG_HLSL_BUILTIN_FN_H_
#include <cstdint>
#include <string>
#include "src/tint/utils/traits/traits.h"
// \cond DO_NOT_DOCUMENT
namespace tint::hlsl {
/// Enumerator of all builtin functions
enum class BuiltinFn : uint8_t {
{{- range $I.Sem.Builtins }}
k{{PascalCase .Name}},
{{- end }}
kNone,
};
/// @returns the name of the builtin function type.
const char* str(BuiltinFn i);
/// Emits the name of the builtin function type.
template <typename STREAM, typename = traits::EnableIfIsOStream<STREAM>>
auto& operator<<(STREAM& o, BuiltinFn i) {
return o << str(i);
}
} // namespace tint::hlsl
// \endcond
#endif // SRC_TINT_LANG_HLSL_BUILTIN_FN_H_