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

◆ stage_params()

void MayaFlux::Buffers::RaymarchProcessor::stage_params ( const std::shared_ptr< VKBuffer > &  buffer)
private

Insert or replace the push constant fragment.

Parameters
bufferBuffer whose pipeline context is staged onto.

Definition at line 137 of file RaymarchProcessor.cpp.

138{
139 auto& fragments = buffer->get_pipeline_context().push_constant_bindings;
140
141 const auto* bytes = reinterpret_cast<const uint8_t*>(&m_params);
142
143 auto it = std::ranges::find_if(fragments, [](const auto& entry) {
144 return entry.name == k_fragment_name;
145 });
146
147 if (it == fragments.end()) {
148 fragments.push_back(Portal::Graphics::PushConstantBindingInfo {
149 .offset = 0,
150 .data = std::vector<uint8_t>(bytes, bytes + sizeof(MarchParams)),
151 .name = k_fragment_name,
152 });
153 return;
154 }
155
156 it->offset = 0;
157 it->data.assign(bytes, bytes + sizeof(MarchParams));
158}

References m_params, and MayaFlux::Portal::Graphics::PushConstantBindingInfo::offset.

Referenced by on_attach(), and processing_function().

+ Here is the caller graph for this function: