blob: 3ea8b69c758ea571e25f71239fce6cc1cea03347 [file] [log] [blame]
{{- /*
--------------------------------------------------------------------------------
Template file for use with tools/src/cmd/gen to generate extension.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 "extension") -}}
#ifndef SRC_TINT_LANG_WGSL_EXTENSION_H_
#define SRC_TINT_LANG_WGSL_EXTENSION_H_
#include "src/tint/utils/traits/traits.h"
#include "src/tint/utils/containers/unique_vector.h"
namespace tint::wgsl {
/// An enumerator of WGSL extensions
/// @see src/tint/lang/wgsl/intrinsics.def for extension descriptions
{{ Eval "DeclareEnum" $enum}}
/// All extensions
static constexpr Extension kAllExtensions[] = {
{{- range $entry := $enum.Entries }}
Extension::k{{PascalCase $entry.Name}},
{{- end }}
};
/// A unique vector of extensions
using Extensions = UniqueVector<Extension, 4>;
} // namespace tint::wgsl
#endif // SRC_TINT_LANG_WGSL_EXTENSION_H_