MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ function()

Assemble & MayaFlux::Portal::Graphics::ShaderSpec::Assemble::function ( std::string return_type,
std::string name,
std::string params,
std::string body )
inline

Declare a function emitted before main() in the generated GLSL.

Parameters
return_typeGLSL return type spelling.
nameFunction name, callable from the kernel body.
paramsParameter list verbatim, including types ("vec3 p").
bodyFunction body text without the enclosing braces.

Requires a kernel supplied via MF_KERNEL. Names are emitted as given; two functions sharing a name produce a GLSL redefinition error rather than a silent override.

Definition at line 641 of file ShaderSpec.hpp.

646 {
647 m_functions.push_back({ .return_type = std::move(return_type),
648 .name = std::move(name),
649 .params = std::move(params),
650 .body = std::move(body) });
651 return *this;
652 }
std::vector< FunctionDef > m_functions