mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-25 13:12:00 +00:00
Emits all the enum info from the single-source-of-truth `intrinsics.def` file Change-Id: Ie9deba9e64927945133027cf243777944119ea41 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105327 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Commit-Queue: Ben Clayton <bclayton@google.com>
64 lines
2.0 KiB
Cheetah
64 lines
2.0 KiB
Cheetah
{{- /*
|
|
--------------------------------------------------------------------------------
|
|
Template file for use with tools/src/cmd/gen to generate interpolate_attribute.h
|
|
|
|
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" -}}
|
|
|
|
#ifndef SRC_TINT_AST_INTERPOLATE_ATTRIBUTE_H_
|
|
#define SRC_TINT_AST_INTERPOLATE_ATTRIBUTE_H_
|
|
|
|
#include <ostream>
|
|
#include <string>
|
|
|
|
#include "src/tint/ast/attribute.h"
|
|
|
|
namespace tint::ast {
|
|
|
|
/// The interpolation type.
|
|
{{ Eval "DeclareEnum" (Sem.Enum "interpolation_type") }}
|
|
|
|
/// The interpolation sampling.
|
|
{{ Eval "DeclareEnum" (Sem.Enum "interpolation_sampling") }}
|
|
|
|
/// An interpolate attribute
|
|
class InterpolateAttribute final : public Castable<InterpolateAttribute, Attribute> {
|
|
public:
|
|
/// Create an interpolate attribute.
|
|
/// @param pid the identifier of the program that owns this node
|
|
/// @param nid the unique node identifier
|
|
/// @param src the source of this node
|
|
/// @param type the interpolation type
|
|
/// @param sampling the interpolation sampling
|
|
InterpolateAttribute(ProgramID pid,
|
|
NodeID nid,
|
|
const Source& src,
|
|
InterpolationType type,
|
|
InterpolationSampling sampling);
|
|
~InterpolateAttribute() override;
|
|
|
|
/// @returns the WGSL name for the attribute
|
|
std::string Name() const override;
|
|
|
|
/// Clones this node and all transitive child nodes using the `CloneContext`
|
|
/// `ctx`.
|
|
/// @param ctx the clone context
|
|
/// @return the newly cloned node
|
|
const InterpolateAttribute* Clone(CloneContext* ctx) const override;
|
|
|
|
/// The interpolation type
|
|
const InterpolationType type;
|
|
|
|
/// The interpolation sampling
|
|
const InterpolationSampling sampling;
|
|
};
|
|
|
|
} // namespace tint::ast
|
|
|
|
#endif // SRC_TINT_AST_INTERPOLATE_ATTRIBUTE_H_
|