blob: 0726ef3b526140dd8882e43722067dbde8010218 [file] [log] [blame] [edit]
{{- /*
--------------------------------------------------------------------------------
Template file for use with tools/src/cmd/gen to generate address_space.h
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
--------------------------------------------------------------------------------
*/ -}}
{{- Import "src/tint/templates/enums.tmpl.inc" -}}
{{- $enum := (Sem.Enum "address_space") -}}
#ifndef SRC_TINT_AST_ADDRESS_SPACE_H_
#define SRC_TINT_AST_ADDRESS_SPACE_H_
#include <ostream>
namespace tint::ast {
/// Address space of a given pointer.
{{ Eval "DeclareEnum" $enum}}
/// @returns true if the AddressSpace is host-shareable
/// @param address_space the AddressSpace
/// @see https://gpuweb.github.io/gpuweb/wgsl.html#host-shareable
inline bool IsHostShareable(AddressSpace address_space) {
return address_space == ast::AddressSpace::kUniform || address_space == ast::AddressSpace::kStorage ||
address_space == ast::AddressSpace::kPushConstant;
}
} // namespace tint::ast
#endif // SRC_TINT_AST_ADDRESS_SPACE_H_