blob: 0a811998febd61aca26f673e97ce1c7b01a5b981 [file] [log] [blame] [edit]
{{- /*
--------------------------------------------------------------------------------
Template file for use with tools/src/cmd/gen to generate builtin_fn.cc
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" -}}
#include "src/tint/lang/hlsl/builtin_fn.h"
namespace tint::hlsl {
const char* str(BuiltinFn i) {
switch (i) {
case BuiltinFn::kNone:
return "<none>";
{{- range $I.Sem.Builtins }}
case BuiltinFn::k{{PascalCase .Name}}:
return "{{.Name}}";
{{- end }}
}
return "<unknown>";
}
} // namespace tint::hlsl