MayaFlux 1.0.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 173 of file RaymarchProcessor.cpp.

174{
175 auto& fragments = buffer->get_pipeline_context().push_constant_bindings;
176
177 const auto* bytes = reinterpret_cast<const uint8_t*>(&m_params);
178
179 auto it = std::ranges::find_if(fragments, [](const auto& entry) {
180 return entry.name == k_fragment_name;
181 });
182
183 if (it == fragments.end()) {
184 fragments.push_back(Portal::Graphics::PushConstantBindingInfo {
185 .offset = 0,
186 .data = std::vector<uint8_t>(bytes, bytes + sizeof(MarchParams)),
187 .name = k_fragment_name,
188 });
189 return;
190 }
191
192 it->offset = 0;
193 it->data.assign(bytes, bytes + sizeof(MarchParams));
194}
std::shared_ptr< NetworkGeometryBuffer > buffer

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

Referenced by on_attach(), and processing_function().

+ Here is the caller graph for this function: