MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Portal::Graphics::ShaderSpec Struct Reference

Complete declarative description of a generated compute shader. More...

#include <ShaderSpec.hpp>

+ Collaboration diagram for MayaFlux::Portal::Graphics::ShaderSpec:

Classes

class  Assemble
 Fluent assembler producing a ShaderSpec. More...
 

Public Attributes

std::vector< BindingSlotbindings
 
std::optional< KernelSourcekernel
 When set, KernelOp is ignored.
 
KernelOp op { KernelOp::Scale }
 
std::vector< PushConstantFieldpc_fields
 
uint32_t push_constant_bytes { 0 }
 
KernelTemplate tmpl { KernelTemplate::Elementwise }
 
std::array< uint32_t, 3 > workgroup_size { 256, 1, 1 }
 

Detailed Description

Complete declarative description of a generated compute shader.

Pure value type. Consumed by ShaderFoundry::load_shader(const ShaderSpec&) which emits SPIR-V assembly via VKShaderModule::emit_spirv_asm() and assembles it via VKShaderModule::create_from_spirv_asm(). No shaderc or GLSL toolchain is involved.

The op field selects a named operation the emitter knows how to lower to SPIR-V opcodes deterministically. PC fields are consumed in declaration order as operands.

auto spec = ShaderSpec::Assemble{}
.pc("gain")
.pc("offset")
.build();
Assemble & op(KernelOp o)
Set the named operation the emitter will lower to SPIR-V.
ShaderSpec build()
Finalise and return the ShaderSpec.
Assemble & pc(std::string name, Kakshya::GpuDataFormat format)
Declare a push constant field with explicit format.
Assemble & ssbo(std::string name, BindingDirection direction, Kakshya::GpuDataFormat format, Kakshya::DataModality modality=Kakshya::DataModality::SCALAR_F32)
Declare an SSBO binding.
Fluent assembler producing a ShaderSpec.

Definition at line 330 of file ShaderSpec.hpp.


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