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

◆ bindings_from_spec()

std::vector< GpuBufferBinding > MayaFlux::Yantra::bindings_from_spec ( const Portal::Graphics::ShaderSpec spec)
inline

Derive a GpuBufferBinding list from a ShaderSpec.

Translates ShaderSpec binding declarations to the GpuBufferBinding vocabulary understood by GpuResourceManager and any GpuExecutionContext subclass. The result is suitable for passing to declare_buffer_bindings() overrides or directly to GpuResourceManager::initialise().

Definition at line 59 of file ShaderSpecBinding.hpp.

61{
62 std::vector<GpuBufferBinding> out;
63 out.reserve(spec.bindings.size());
64 for (const auto& b : spec.bindings) {
65 out.push_back({
66 .set = b.set,
67 .binding = b.binding_index,
68 .direction = to_binding_direction(b.direction),
69 .element_type = to_element_type(b.modality, b.format),
70 });
71 }
72 return out;
73}
size_t b
GpuBufferBinding::Direction to_binding_direction(Portal::Graphics::BindingDirection d) noexcept
Translate a BindingDirection to a GpuBufferBinding::Direction.
GpuBufferBinding::ElementType to_element_type(Kakshya::DataModality m, Kakshya::GpuDataFormat fmt) noexcept
Translate a BindingSlot modality to a GpuBufferBinding::ElementType.
std::vector< BindingSlot > bindings

References b, MayaFlux::Portal::Graphics::ShaderSpec::bindings, to_binding_direction(), and to_element_type().

Referenced by MayaFlux::Yantra::ComputationGrammar::RuleBuilder::executes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: