MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
AsmGenerator.cpp File Reference

SPIR-V assembly and GLSL kernel emitters for ShaderSpec. More...

#include "ShaderFoundry.hpp"
+ Include dependency graph for AsmGenerator.cpp:

Go to the source code of this file.

Namespaces

namespace  MayaFlux
 Main namespace for the Maya Flux audio engine.
 
namespace  MayaFlux::Portal
 
namespace  MayaFlux::Portal::Graphics
 
namespace  MayaFlux::Portal::Graphics::detail
 

Functions

std::string MayaFlux::Portal::Graphics::detail::emit_glsl_kernel (const ShaderSpec &spec)
 Emit a complete GLSL compute shader from spec metadata and a KernelSource body.
 
std::string MayaFlux::Portal::Graphics::detail::emit_spirv_asm (const ShaderSpec &spec)
 Emit complete SPIR-V assembly text for a generated compute kernel.
 

Detailed Description

SPIR-V assembly and GLSL kernel emitters for ShaderSpec.

The assembly path (emit_spirv_asm) covers all binding modalities and kernel templates:

SSBO (SCALAR_F32, VEC2_F32, VEC3_F32, VEC4_F32) — all KernelOps via emit_elementwise_body. ArrayStride, element type, and pointer type derived from GpuDataFormat. Scalar PC operands splatted to vector width via OpCompositeConstruct before arithmetic.

IMAGE_2D storage images — emit_image_body handles any number of Input/InOut images and one Output image with all single- and two-operand KernelOps applied per channel.

TEXTURE_2D sampled images — emit_image_body loads each binding via OpTypeSampledImage / OpImageSampleExplicitLod at normalised UV derived from GlobalInvocationID divided by width/height PC fields (first two PC fields by convention when TEXTURE_2D bindings are present).

KernelTemplate::Reduction — emit_reduction_body emits a structured workgroup tree reduction with OpLoopMerge, OpPhi for the stride variable, OpULessThan active-thread guard, and two OpControlBarrier synchronisation points per iteration. Supports KernelOp::Sum and KernelOp::Max.

GLSL kernel path (emit_glsl_kernel) handles all three binding modalities when spec.kernel is set via MF_KERNEL.

Definition in file AsmGenerator.cpp.