25 template <
typename C,
typename R,
typename A>
31 template <
typename C,
typename R,
typename A,
typename B>
35 using aux = std::decay_t<B>;
68template <
typename D,
typename R>
114template <
typename D,
typename R>
139template <
typename Lambda>
140[[nodiscard]]
auto dual_field(std::string
name, Lambda&& fn, std::string_view text)
143 using D =
typename Sig::domain;
144 using R =
typename Sig::range;
159template <
typename Lambda>
163 using D =
typename Sig::domain;
164 using R =
typename Sig::range;
166 static_assert(std::is_same_v<typename Sig::aux, float>,
167 "MF_FIELD_T: the second parameter must be float");
193#define MF_FIELD(name, lambda) \
194 MayaFlux::Kinesis::dual_field(#name, lambda, #lambda)
203#define MF_FIELD_T(name, lambda) \
204 MayaFlux::Kinesis::temporal_field(#name, lambda, #lambda)
GLSL type and function spellings made valid as C++.
auto temporal_field(std::string name, Lambda &&, std::string_view text)
Build a TemporalField from a lambda and its stringified text.
auto dual_field(std::string name, Lambda &&fn, std::string_view text)
Build a DualField from a lambda and its stringified text.
R operator()(const D &d) const
Evaluate the host half.
bool has_source() const noexcept
Whether the shader half parsed into a usable function definition.
One authored expression carried as both a host callable and shader text.
static FieldSource parse(std::string fn_name, std::string_view text)
Extract return type, parameter list and body from lambda text.
bool valid() const noexcept
Whether parsing produced a usable function definition.
Parsed representation of a stringified field lambda.
bool has_source() const noexcept
Whether the shader half parsed into a usable function definition.
An authored expression of position and time, shader-only.
std::function< R(const D &)> fn
Typed, composable, stateless callable from domain D to range R.
Extracts domain and range types from a non-generic lambda.