blob: 7c88975ee02a4af461705ee8c2eedba08467a5f8 [file] [log] [blame]
{{- /*
--------------------------------------------------------------------------------
Template file for use with tools/src/cmd/gen to generate language_feature.h
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/wgsl/wgsl.def" -}}
{{- Import "src/tint/utils/templates/enums.tmpl.inc" -}}
{{- $enum := ($I.Sem.Enum "language_feature") -}}
#ifndef SRC_TINT_LANG_WGSL_LANGUAGE_FEATURE_H_
#define SRC_TINT_LANG_WGSL_LANGUAGE_FEATURE_H_
#include "src/tint/utils/traits/traits.h"
#include "src/tint/utils/containers/unique_vector.h"
namespace tint::wgsl {
/// An enumerator of WGSL language features
/// @see src/tint/lang/wgsl/intrinsics.def for language feature descriptions
{{ Eval "DeclareEnum" $enum}}
/// All features
static constexpr LanguageFeature kAllLanguageFeatures[] = {
{{- range $entry := $enum.Entries }}
LanguageFeature::k{{PascalCase $entry.Name}},
{{- end }}
};
/// A unique vector of language features
using LanguageFeatures = UniqueVector<LanguageFeature, 4>;
} // namespace tint::wgsl
#endif // SRC_TINT_LANG_WGSL_LANGUAGE_FEATURE_H_