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

◆ emit_lagged_pair()

std::string MayaFlux::Portal::Graphics::detail::emit_lagged_pair ( const ShaderSpec & spec)
nodiscard

Emit the globals, soft-double functions and entry point of the LaggedPair template.

Returns an empty string when the spec does not have the template's shape: two VEC2_U32 bindings, seven UINT32 push constants and a power of two workgroup size from 2 to 1024.

Definition at line 1170 of file AsmSoftDouble.cpp.

1171{
1172 const uint32_t local = spec.workgroup_size[0];
1173 const bool shaped = spec.bindings.size() == 2 && spec.pc_fields.size() == 7
1174 && std::ranges::all_of(spec.bindings, [](const BindingSlot& b) {
1175 return b.format == Kakshya::GpuDataFormat::VEC2_U32;
1176 })
1177 && std::ranges::all_of(spec.pc_fields, [](const PushConstantField& f) {
1178 return f.format == Kakshya::GpuDataFormat::UINT32;
1179 });
1180 const bool sized = local >= 2 && local <= 1024 && (local & (local - 1)) == 0;
1181 if (!shaped || !sized) {
1182 return {};
1183 }
1184
1185 Builder builder;
1186 return builder.lagged_pair(spec);
1187}
Declaration of one SSBO or image binding in a generated shader.
One field in the generated push constant block.
std::vector< PushConstantField > pc_fields
std::vector< BindingSlot > bindings
std::array< uint32_t, 3 > workgroup_size

References MayaFlux::Portal::Graphics::ShaderSpec::bindings, MayaFlux::Portal::Graphics::ShaderSpec::pc_fields, and MayaFlux::Portal::Graphics::ShaderSpec::workgroup_size.

Referenced by emit_spirv_asm().

Here is the caller graph for this function: