| {{- /* |
| -------------------------------------------------------------------------------- |
| Template file for use with tools/intrinsic-gen to generate intrinsic_type.h |
| |
| See: |
| * tools/cmd/intrinsic-gen/gen for structures used by this template |
| * https://golang.org/pkg/text/template/ for documentation on the template syntax |
| -------------------------------------------------------------------------------- |
| */ -}} |
| |
| #ifndef SRC_SEM_INTRINSIC_TYPE_H_ |
| #define SRC_SEM_INTRINSIC_TYPE_H_ |
| |
| #include <string> |
| #include <sstream> |
| |
| namespace tint { |
| namespace sem { |
| |
| /// Enumerator of all intrinsic functions |
| enum class IntrinsicType { |
| kNone = -1, |
| {{- range .Sem.Functions }} |
| k{{Title .Name}}, |
| {{- end }} |
| }; |
| |
| /// Matches the IntrinsicType by name |
| /// @param name the intrinsic name to parse |
| /// @returns the parsed IntrinsicType, or IntrinsicType::kNone if `name` did not |
| /// match any intrinsic. |
| IntrinsicType ParseIntrinsicType(const std::string& name); |
| |
| /// @returns the name of the intrinsic function type. The spelling, including |
| /// case, matches the name in the WGSL spec. |
| const char* str(IntrinsicType i); |
| |
| /// Emits the name of the intrinsic function type. The spelling, including case, |
| /// matches the name in the WGSL spec. |
| std::ostream& operator<<(std::ostream& out, IntrinsicType i); |
| |
| } // namespace sem |
| } // namespace tint |
| |
| #endif // SRC_SEM_INTRINSIC_TYPE_H_ |