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

◆ collect_push_writes()

void MayaFlux::Buffers::ComputeProcessor::collect_push_writes ( const std::shared_ptr< VKBuffer > & buffer,
std::vector< Portal::Graphics::PushDescriptorWrite > & writes )
protectedvirtual

Collect the writes for the push descriptor set, set 0.

Parameters
bufferBuffer under processing.
writesReceives one entry per binding of set 0.

Called once per dispatch, after the pipeline is bound, so a binding that changes between cycles needs no descriptor rewrite. The default pushes the buffer's staged set 0 bindings and the bound buffers whose config binding is in set 0. Subclasses that resolve handles per cycle (field generations, ping-pong state, textures) call the parent, then append their own writes.

Reimplemented in MayaFlux::Buffers::NetworkStateFieldProcessor, MayaFlux::Buffers::RelaxationEmitProcessor, MayaFlux::Buffers::RelaxationStepProcessor, MayaFlux::Buffers::UVFieldProcessor, MayaFlux::Buffers::VertexFieldProcessor, MayaFlux::Buffers::VolumeFieldProcessor, and MayaFlux::Buffers::VolumeSurfaceProcessor.

Definition at line 331 of file ComputeProcessor.cpp.

334{
335 std::set<uint32_t> staged;
336
337 for (const auto& binding : buffer->get_pipeline_context().descriptor_buffer_bindings) {
338 if (binding.set != 0) {
339 continue;
340 }
341
342 writes.push_back({
343 .binding = binding.binding,
344 .type = binding.type,
345 .buffer = binding.buffer_info,
346 });
347 staged.insert(binding.binding);
348 }
349
350 for (const auto& [name, bound] : m_bound_buffers) {
351 const auto config = m_config.bindings.find(name);
352 if (config == m_config.bindings.end()
353 || config->second.set != 0
354 || staged.contains(config->second.binding)) {
355 continue;
356 }
357
358 writes.push_back({
359 .binding = config->second.binding,
360 .type = config->second.type,
361 .buffer = vk::DescriptorBufferInfo(bound->get_buffer(), 0, bound->get_size_bytes()),
362 });
363 }
364}
std::unordered_map< std::string, std::shared_ptr< VKBuffer > > m_bound_buffers

References MayaFlux::Buffers::ShaderProcessor::m_bound_buffers, and MayaFlux::Buffers::ShaderProcessor::m_config.

Referenced by MayaFlux::Buffers::NetworkStateFieldProcessor::collect_push_writes(), MayaFlux::Buffers::RelaxationEmitProcessor::collect_push_writes(), MayaFlux::Buffers::RelaxationStepProcessor::collect_push_writes(), MayaFlux::Buffers::UVFieldProcessor::collect_push_writes(), MayaFlux::Buffers::VertexFieldProcessor::collect_push_writes(), MayaFlux::Buffers::VolumeFieldProcessor::collect_push_writes(), MayaFlux::Buffers::VolumeSurfaceProcessor::collect_push_writes(), and execute_shader().

Here is the caller graph for this function: