MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Kinesis::FieldSource Struct Reference

Parsed representation of a stringified field lambda. More...

#include <FieldSource.hpp>

+ Collaboration diagram for MayaFlux::Kinesis::FieldSource:

Public Member Functions

bool valid () const noexcept
 Whether parsing produced a usable function definition.
 

Static Public Member Functions

static FieldSource parse (std::string fn_name, std::string_view text)
 Extract return type, parameter list and body from lambda text.
 

Public Attributes

std::string body
 
std::string name
 
std::string params
 
std::string return_type
 

Detailed Description

Parsed representation of a stringified field lambda.

Produced by MF_FIELD, which stringifies the lambda text at the call site. Shares an input shape with Portal::Graphics::KernelSource but not a consumer, and differs in one respect: the parameter list is retained verbatim rather than stripped to identifiers, because a field is emitted as a standalone GLSL function above main() where the signature needs types. KernelSource strips them because a main-injected body receives its operands as file-scope declarations.

Nothing here knows about ShaderSpec. The four members map onto the four arguments of ShaderSpec::Assemble::function(), and that call happens at the site assembling a spec, which is above both Kinesis and Portal.

auto spec = ShaderSpec::Assemble{}
.ssbo("pos", BindingDirection::InOut, Kakshya::GpuDataFormat::VEC4_F32)
.function(swirl.source.return_type, swirl.source.name,
swirl.source.params, swirl.source.body)
.kernel(MF_KERNEL(...))
.build();
#define MF_KERNEL(lambda)
Stringifies a kernel lambda for use with ShaderSpec::Assemble::kernel().

Definition at line 30 of file FieldSource.hpp.


The documentation for this struct was generated from the following file: