blob: 4c5db03b79bcb0130f9050ced021fea9e930690b [file] [log] [blame]
{{- /*
--------------------------------------------------------------------------------
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/glsl/glsl.def" -}}
#include "src/tint/lang/glsl/builtin_fn.h"
namespace tint::glsl {
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::glsl